#390: fixed specs

This commit is contained in:
Vokhmin Alexey V 2014-05-22 23:47:02 +04:00
parent 5404a7e75a
commit d48e9269aa
1 changed files with 5 additions and 0 deletions

View File

@ -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')