summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-01-15 14:03:52 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-01-15 14:03:52 +0200
commit2e7abbd66c1e68eaf6cd227ce7e26e2d9a3d4180 (patch)
tree81577800cca14a6232857a0177ca31dd4695b678 /spec
parent065d9c22faf4ae5cdc5dd17f6b655aa15433d5d8 (diff)
downloadgitlab-ce-2e7abbd66c1e68eaf6cd227ce7e26e2d9a3d4180.tar.gz
Move repo rename email to notification service
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'spec')
-rw-r--r--spec/services/notification_service_spec.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/spec/services/notification_service_spec.rb b/spec/services/notification_service_spec.rb
index a112835d4d0..09a5debe1dc 100644
--- a/spec/services/notification_service_spec.rb
+++ b/spec/services/notification_service_spec.rb
@@ -233,6 +233,31 @@ describe NotificationService do
end
end
+ describe 'Projects' do
+ let(:project) { create :project }
+
+ before do
+ build_team(project)
+ end
+
+ describe :project_was_moved do
+ it do
+ should_email(@u_watcher.id)
+ should_email(@u_participating.id)
+ should_not_email(@u_disabled.id)
+ notification.project_was_moved(project)
+ end
+
+ def should_email(user_id)
+ Notify.should_receive(:project_was_moved_email).with(project.id, user_id)
+ end
+
+ def should_not_email(user_id)
+ Notify.should_not_receive(:project_was_moved_email).with(project.id, user_id)
+ end
+ end
+ end
+
def build_team(project)
@u_watcher = create(:user, notification_level: Notification::N_WATCH)
@u_participating = create(:user, notification_level: Notification::N_PARTICIPATING)