summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2015-09-21 15:35:29 -0400
committerRobert Speicher <rspeicher@gmail.com>2015-09-21 15:35:29 -0400
commit2f88459297d9fe8a33f608bd924f0bd5ad40161b (patch)
tree9587f329baa0cc80e9f1db48e80fc6aebda117fd
parentd4a960161eecf5730b56d3f375573fa39aa67e95 (diff)
downloadgitlab-ce-rs-fix-spec-warnings.tar.gz
Ensure raise_error expectations provide argumentsrs-fix-spec-warnings
-rw-r--r--spec/models/ci/variable_spec.rb3
-rw-r--r--spec/models/ci/web_hook_spec.rb3
-rw-r--r--spec/requests/ci/api/projects_spec.rb3
-rw-r--r--spec/services/ci/create_project_service_spec.rb3
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