Commit 2f884592 authored by Robert Speicher's avatar Robert Speicher

Ensure raise_error expectations provide arguments

parent d4a96016
...@@ -38,7 +38,8 @@ describe Ci::Variable do ...@@ -38,7 +38,8 @@ describe Ci::Variable do
it 'fails to decrypt if iv is incorrect' do it 'fails to decrypt if iv is incorrect' do
subject.encrypted_value_iv = nil subject.encrypted_value_iv = nil
subject.instance_variable_set(:@value, nil) subject.instance_variable_set(:@value, nil)
expect { subject.value }.to raise_error expect { subject.value }.
to raise_error(OpenSSL::Cipher::CipherError, 'bad decrypt')
end end
end end
end end
...@@ -56,7 +56,8 @@ describe Ci::WebHook do ...@@ -56,7 +56,8 @@ describe Ci::WebHook do
it "catches exceptions" do it "catches exceptions" do
expect(Ci::WebHook).to receive(:post).and_raise("Some HTTP Post error") expect(Ci::WebHook).to receive(:post).and_raise("Some HTTP Post error")
expect{ @web_hook.execute(@data) }.to raise_error expect{ @web_hook.execute(@data) }.
to raise_error(RuntimeError, 'Some HTTP Post error')
end end
end end
end end
...@@ -165,7 +165,8 @@ describe Ci::API::API do ...@@ -165,7 +165,8 @@ describe Ci::API::API do
project.gl_project.team << [user, :master] project.gl_project.team << [user, :master]
delete ci_api("/projects/#{project.id}"), options delete ci_api("/projects/#{project.id}"), options
expect(response.status).to eq(200) expect(response.status).to eq(200)
expect { project.reload }.to raise_error expect { project.reload }.
to raise_error(ActiveRecord::RecordNotFound)
end end
it "non-manager is not authorized" do it "non-manager is not authorized" do
......
...@@ -15,7 +15,8 @@ describe Ci::CreateProjectService do ...@@ -15,7 +15,8 @@ describe Ci::CreateProjectService do
context 'without project dump' do context 'without project dump' do
it 'should raise exception' do it 'should raise exception' do
expect { service.execute(current_user, '', '') }.to raise_error expect { service.execute(current_user, '', '') }.
to raise_error(NoMethodError)
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment