summaryrefslogtreecommitdiff
path: root/spec/services
diff options
context:
space:
mode:
authorJames Lopez <james@jameslopez.es>2017-06-22 12:10:28 +0200
committerJames Lopez <james@jameslopez.es>2017-06-23 11:41:42 +0200
commit0ee002c70ea3711046b8d254b5cba044762e9c05 (patch)
treefe61f06a538f4d43e36ce5d68f8627cb51ceb5e8 /spec/services
parent4c75fe5dfe898b7c4882c88364df936460891e2a (diff)
downloadgitlab-ce-0ee002c70ea3711046b8d254b5cba044762e9c05.tar.gz
more refactoring
Diffstat (limited to 'spec/services')
-rw-r--r--spec/services/emails/create_service_spec.rb10
-rw-r--r--spec/services/emails/destroy_service_spec.rb12
2 files changed, 0 insertions, 22 deletions
diff --git a/spec/services/emails/create_service_spec.rb b/spec/services/emails/create_service_spec.rb
index 9981f5fcc2b..76bf35d34e8 100644
--- a/spec/services/emails/create_service_spec.rb
+++ b/spec/services/emails/create_service_spec.rb
@@ -17,15 +17,5 @@ describe Emails::CreateService, services: true do
expect(user.emails).to eq(Email.where(opts))
end
-
- it 'does not create an email if the user has no permissions' do
- 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
- expect do
- described_class.new(create(:user), user, opts).execute(skip_authorization: true)
- end.to change { Email.count }.by(1)
- end
end
end
diff --git a/spec/services/emails/destroy_service_spec.rb b/spec/services/emails/destroy_service_spec.rb
index 6db050148cb..3f5192b620e 100644
--- a/spec/services/emails/destroy_service_spec.rb
+++ b/spec/services/emails/destroy_service_spec.rb
@@ -10,17 +10,5 @@ describe Emails::DestroyService, services: true do
it 'removes an email' do
expect { service.execute }.to change { user.emails.count }.by(-1)
end
-
- it 'does not remove an email if the user has no permissions' do
- 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, email: email.email).execute(skip_authorization: true)
- end.to change { Email.count }.by(-1)
- end
end
end