From d48e9269aa6be6d484023b1c1b4b5321fc423545 Mon Sep 17 00:00:00 2001 From: Vokhmin Alexey V Date: Thu, 22 May 2014 23:47:02 +0400 Subject: [PATCH] #390: fixed specs --- spec/controllers/api/v1/build_lists_controller_spec.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/spec/controllers/api/v1/build_lists_controller_spec.rb b/spec/controllers/api/v1/build_lists_controller_spec.rb index 8ccb22ccc..b875f81fa 100644 --- a/spec/controllers/api/v1/build_lists_controller_spec.rb +++ b/spec/controllers/api/v1/build_lists_controller_spec.rb @@ -112,6 +112,10 @@ describe Api::V1::BuildListsController do put :rerun_tests, id: @build_list, format: :json 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 { http_login(@owner_user) } @@ -125,6 +129,7 @@ describe Api::V1::BuildListsController do context 'returns an error if the can not rerun_tests' do before do allow_any_instance_of(BuildList).to receive(:rerun_tests).and_return(false) + do_rerun_tests end it_should_behave_like 'validation error via build list api', I18n.t('layout.build_lists.rerun_tests_fail')