Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Lopez <james@jameslopez.es>2017-06-16 16:14:46 +0300
committerJames Lopez <james@jameslopez.es>2017-06-23 12:41:42 +0300
commitad44af2faaaa872ee30922699f66ac78fa402336 (patch)
treee264d9bf4e57dc3468281167374da3f53e7ebe57 /spec/services/emails
parent7aaf3692b3856fa4d11bfc51ef4ab18c7405fc06 (diff)
fixed specs
Diffstat (limited to 'spec/services/emails')
-rw-r--r--spec/services/emails/create_service_spec.rb2
-rw-r--r--spec/services/emails/destroy_service_spec.rb6
2 files changed, 5 insertions, 3 deletions
diff --git a/spec/services/emails/create_service_spec.rb b/spec/services/emails/create_service_spec.rb
index 7874da88665..9981f5fcc2b 100644
--- a/spec/services/emails/create_service_spec.rb
+++ b/spec/services/emails/create_service_spec.rb
@@ -19,7 +19,7 @@ describe Emails::CreateService, services: true do
end
it 'does not create an email if the user has no permissions' do
- expect { described_class.new(create(:user), user, opts).execute }.not_to change { Email.count }
+ expect { described_class.new(create(:user), user, opts).execute }.to raise_error(Gitlab::Access::AccessDeniedError)
end
it 'creates an email if we skip authorization' do
diff --git a/spec/services/emails/destroy_service_spec.rb b/spec/services/emails/destroy_service_spec.rb
index 186726951f9..6db050148cb 100644
--- a/spec/services/emails/destroy_service_spec.rb
+++ b/spec/services/emails/destroy_service_spec.rb
@@ -12,12 +12,14 @@ describe Emails::DestroyService, services: true do
end
it 'does not remove an email if the user has no permissions' do
- expect { described_class.new(create(:user), user, opts).execute }.not_to change { Email.count }
+ expect do
+ described_class.new(create(:user), user, email: email.email).execute
+ end.to raise_error(Gitlab::Access::AccessDeniedError)
end
it 'removes an email if we skip authorization' do
expect do
- described_class.new(create(:user), user, opts).execute(skip_authorization: true)
+ described_class.new(create(:user), user, email: email.email).execute(skip_authorization: true)
end.to change { Email.count }.by(-1)
end
end