summaryrefslogtreecommitdiff
path: root/spec/services/notification_service_spec.rb
diff options
context:
space:
mode:
authorhttp://jneen.net/ <jneen@jneen.net>2017-08-04 11:54:19 -0700
committerhttp://jneen.net/ <jneen@jneen.net>2017-08-11 16:02:03 -0700
commit0268fc2ffc7cdc12a6e1a0bf565fe70ff8541398 (patch)
treeff0553523c5344695453e1b3e583ba265dccfb39 /spec/services/notification_service_spec.rb
parentd5054abfcc1b27c664bff46ae6dc1482c591e5a9 (diff)
downloadgitlab-ce-0268fc2ffc7cdc12a6e1a0bf565fe70ff8541398.tar.gz
check notifiability for more emails
Diffstat (limited to 'spec/services/notification_service_spec.rb')
-rw-r--r--spec/services/notification_service_spec.rb36
1 files changed, 28 insertions, 8 deletions
diff --git a/spec/services/notification_service_spec.rb b/spec/services/notification_service_spec.rb
index 64981c199e4..b6110da83b5 100644
--- a/spec/services/notification_service_spec.rb
+++ b/spec/services/notification_service_spec.rb
@@ -1173,19 +1173,39 @@ describe NotificationService, :mailer do
end
end
- describe '#project_exported' do
- it do
- notification.project_exported(project, @u_disabled)
+ context 'user with notifications disabled' do
+ describe '#project_exported' do
+ it do
+ notification.project_exported(project, @u_disabled)
+
+ should_not_email_anyone
+ end
+ end
+
+ describe '#project_not_exported' do
+ it do
+ notification.project_not_exported(project, @u_disabled, ['error'])
- should_only_email(@u_disabled)
+ should_not_email_anyone
+ end
end
end
- describe '#project_not_exported' do
- it do
- notification.project_not_exported(project, @u_disabled, ['error'])
+ context 'user with notifications enabled' do
+ describe '#project_exported' do
+ it do
+ notification.project_exported(project, @u_participating)
+
+ should_only_email(@u_participating)
+ end
+ end
+
+ describe '#project_not_exported' do
+ it do
+ notification.project_not_exported(project, @u_participating, ['error'])
- should_only_email(@u_disabled)
+ should_only_email(@u_participating)
+ end
end
end
end