diff --git a/spec/services/notification_service_spec.rb b/spec/services/notification_service_spec.rb index a6ceb67de1bcd65c44b7f8d7df505d5cbd5fcfd9..6a63a8aceb2c6883e8992fbe5fc5bc8d6e59042d 100644 --- a/spec/services/notification_service_spec.rb +++ b/spec/services/notification_service_spec.rb @@ -2,6 +2,7 @@ require 'spec_helper' describe NotificationService do let(:notification) { NotificationService.new } + describe 'Keys' do describe :new_key do let(:key) { create(:personal_key) } @@ -158,7 +159,6 @@ describe NotificationService do let(:merge_request) { create :merge_request, assignee: create(:user) } before do - build_team(merge_request.source_project) build_team(merge_request.target_project) end @@ -235,16 +235,11 @@ describe NotificationService do end end - let(:u_watcher) { create(:user, notification_level: Notification::N_WATCH) } - let(:u_participating) { create(:user, notification_level: Notification::N_PARTICIPATING) } - let(:u_disabled) { create(:user, notification_level: Notification::N_DISABLED) } - let(:u_mentioned) { create(:user, username: 'mention', notification_level: Notification::N_WATCH) } - def build_team(project) - @u_watcher = u_watcher - @u_participating = u_participating - @u_disabled = u_disabled - @u_mentioned = u_mentioned + @u_watcher = create(:user, notification_level: Notification::N_WATCH) + @u_participating = create(:user, notification_level: Notification::N_PARTICIPATING) + @u_disabled = create(:user, notification_level: Notification::N_DISABLED) + @u_mentioned = create(:user, username: 'mention', notification_level: Notification::N_PARTICIPATING) project.team << [@u_watcher, :master] project.team << [@u_participating, :master]