From 493fe62d8ddfb89490a235ad0d96fa735aa8dbe0 Mon Sep 17 00:00:00 2001 From: Vokhmin Alexey V Date: Thu, 29 May 2014 01:53:50 +0400 Subject: [PATCH] #394: fixed specs --- spec/controllers/api/v1/build_lists_controller_spec.rb | 5 ++++- spec/controllers/projects/build_lists_controller_spec.rb | 9 +++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/spec/controllers/api/v1/build_lists_controller_spec.rb b/spec/controllers/api/v1/build_lists_controller_spec.rb index b875f81fa..df5c5d01c 100644 --- a/spec/controllers/api/v1/build_lists_controller_spec.rb +++ b/spec/controllers/api/v1/build_lists_controller_spec.rb @@ -82,7 +82,10 @@ shared_examples_for 'validation error via build list api' do |message| end describe Api::V1::BuildListsController do - before { stub_symlink_methods } + before do + stub_symlink_methods + allow_any_instance_of(BuildList).to receive(:valid_branch_for_publish?).and_return(true) + end context 'create and update abilities' do context 'for user' do diff --git a/spec/controllers/projects/build_lists_controller_spec.rb b/spec/controllers/projects/build_lists_controller_spec.rb index 043f066c0..c8ea7d361 100644 --- a/spec/controllers/projects/build_lists_controller_spec.rb +++ b/spec/controllers/projects/build_lists_controller_spec.rb @@ -77,10 +77,7 @@ describe Projects::BuildListsController do end end - before do - stub_symlink_methods - allow_any_instance_of(BuildList).to receive(:valid_branch_for_publish?).and_return(true) - end + before { stub_symlink_methods } context 'crud' do before do @@ -132,6 +129,10 @@ describe Projects::BuildListsController do put :rerun_tests, id: @build_list end + before do + allow_any_instance_of(BuildList).to receive(:can_rerun_tests?).and_return(true) + end + context 'if user is project owner' do before { set_session_for(@owner_user) }