diff options
author | Robert Speicher <robert@gitlab.com> | 2015-09-21 20:54:14 +0000 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2015-09-21 20:54:14 +0000 |
commit | c1399cbc6667361bb0c42a0cdf83aa175e4b9dac (patch) | |
tree | e5d86e416d5bac34f1f2c15e97c8032b045df3f5 | |
parent | ba71542a5a14f703710a146f58b53bb503215060 (diff) | |
parent | 2f88459297d9fe8a33f608bd924f0bd5ad40161b (diff) | |
download | gitlab-ce-c1399cbc6667361bb0c42a0cdf83aa175e4b9dac.tar.gz |
Merge branch 'rs-fix-spec-warnings' into 'master'
Ensure raise_error expectations provide arguments
See merge request !1381
-rw-r--r-- | spec/models/ci/variable_spec.rb | 3 | ||||
-rw-r--r-- | spec/models/ci/web_hook_spec.rb | 3 | ||||
-rw-r--r-- | spec/requests/ci/api/projects_spec.rb | 3 | ||||
-rw-r--r-- | spec/services/ci/create_project_service_spec.rb | 3 |
4 files changed, 8 insertions, 4 deletions
diff --git a/spec/models/ci/variable_spec.rb b/spec/models/ci/variable_spec.rb index 97a3d0081f4..d034a6c7b9f 100644 --- a/spec/models/ci/variable_spec.rb +++ b/spec/models/ci/variable_spec.rb @@ -38,7 +38,8 @@ describe Ci::Variable do it 'fails to decrypt if iv is incorrect' do subject.encrypted_value_iv = 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 diff --git a/spec/models/ci/web_hook_spec.rb b/spec/models/ci/web_hook_spec.rb index c4c0b007c11..bf9481ab81d 100644 --- a/spec/models/ci/web_hook_spec.rb +++ b/spec/models/ci/web_hook_spec.rb @@ -56,7 +56,8 @@ describe Ci::WebHook do it "catches exceptions" do 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 diff --git a/spec/requests/ci/api/projects_spec.rb b/spec/requests/ci/api/projects_spec.rb index 2adae52e79e..409f47fa448 100644 --- a/spec/requests/ci/api/projects_spec.rb +++ b/spec/requests/ci/api/projects_spec.rb @@ -165,7 +165,8 @@ describe Ci::API::API do project.gl_project.team << [user, :master] delete ci_api("/projects/#{project.id}"), options expect(response.status).to eq(200) - expect { project.reload }.to raise_error + expect { project.reload }. + to raise_error(ActiveRecord::RecordNotFound) end it "non-manager is not authorized" do diff --git a/spec/services/ci/create_project_service_spec.rb b/spec/services/ci/create_project_service_spec.rb index c0af515aa8f..2de7b0deca7 100644 --- a/spec/services/ci/create_project_service_spec.rb +++ b/spec/services/ci/create_project_service_spec.rb @@ -15,7 +15,8 @@ describe Ci::CreateProjectService do context 'without project dump' 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 |