Address minor review comments for tests
This commit is contained in:
parent
6bf7b627d1
commit
8a6e9b934e
3 changed files with 17 additions and 17 deletions
|
@ -331,7 +331,7 @@ describe Issues::UpdateService, services: true do
|
||||||
perform_enqueued_jobs { update_issue(title: user4.to_reference) }
|
perform_enqueued_jobs { update_issue(title: user4.to_reference) }
|
||||||
end
|
end
|
||||||
|
|
||||||
it "should email only the newly-mentioned user" do
|
it 'emails only the newly-mentioned user' do
|
||||||
should_not_email(user)
|
should_not_email(user)
|
||||||
should_not_email(user2)
|
should_not_email(user2)
|
||||||
should_not_email(user3)
|
should_not_email(user3)
|
||||||
|
@ -339,12 +339,12 @@ describe Issues::UpdateService, services: true do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context "in description" do
|
context 'in description' do
|
||||||
before do
|
before do
|
||||||
perform_enqueued_jobs { update_issue(description: user4.to_reference) }
|
perform_enqueued_jobs { update_issue(description: user4.to_reference) }
|
||||||
end
|
end
|
||||||
|
|
||||||
it "should email only the newly-mentioned user" do
|
it 'emails only the newly-mentioned user' do
|
||||||
should_not_email(user)
|
should_not_email(user)
|
||||||
should_not_email(user2)
|
should_not_email(user2)
|
||||||
should_not_email(user3)
|
should_not_email(user3)
|
||||||
|
|
|
@ -232,12 +232,12 @@ describe MergeRequests::UpdateService, services: true do
|
||||||
project.team << [user4, :developer]
|
project.team << [user4, :developer]
|
||||||
end
|
end
|
||||||
|
|
||||||
context "in title" do
|
context 'in title' do
|
||||||
before do
|
before do
|
||||||
perform_enqueued_jobs { update_merge_request(title: user4.to_reference) }
|
perform_enqueued_jobs { update_merge_request(title: user4.to_reference) }
|
||||||
end
|
end
|
||||||
|
|
||||||
it "should email only the newly-mentioned user" do
|
it 'emails only the newly-mentioned user' do
|
||||||
should_not_email(user)
|
should_not_email(user)
|
||||||
should_not_email(user2)
|
should_not_email(user2)
|
||||||
should_not_email(user3)
|
should_not_email(user3)
|
||||||
|
@ -245,12 +245,12 @@ describe MergeRequests::UpdateService, services: true do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context "in description" do
|
context 'in description' do
|
||||||
before do
|
before do
|
||||||
perform_enqueued_jobs { update_merge_request(description: user4.to_reference) }
|
perform_enqueued_jobs { update_merge_request(description: user4.to_reference) }
|
||||||
end
|
end
|
||||||
|
|
||||||
it "should email only the newly-mentioned user" do
|
it 'emails only the newly-mentioned user' do
|
||||||
should_not_email(user)
|
should_not_email(user)
|
||||||
should_not_email(user2)
|
should_not_email(user2)
|
||||||
should_not_email(user3)
|
should_not_email(user3)
|
||||||
|
|
|
@ -405,12 +405,12 @@ describe NotificationService, services: true do
|
||||||
notification.new_mentions_in_issue(issue, new_mentions, @u_disabled)
|
notification.new_mentions_in_issue(issue, new_mentions, @u_disabled)
|
||||||
end
|
end
|
||||||
|
|
||||||
it "should not email anyone unless they are newly mentioned" do
|
it 'sends no emails when no new mentions are present' do
|
||||||
send_notifications
|
send_notifications
|
||||||
expect(ActionMailer::Base.deliveries).to eq []
|
expect(ActionMailer::Base.deliveries).to be_empty
|
||||||
end
|
end
|
||||||
|
|
||||||
it "should email new mentions with a watch level higher than participant" do
|
it 'emails new mentions with a watch level higher than participant' do
|
||||||
send_notifications(@u_watcher, @u_participant_mentioned, @u_custom_global)
|
send_notifications(@u_watcher, @u_participant_mentioned, @u_custom_global)
|
||||||
|
|
||||||
should_email(@u_watcher)
|
should_email(@u_watcher)
|
||||||
|
@ -420,9 +420,9 @@ describe NotificationService, services: true do
|
||||||
expect(ActionMailer::Base.deliveries.count).to eq 3
|
expect(ActionMailer::Base.deliveries.count).to eq 3
|
||||||
end
|
end
|
||||||
|
|
||||||
it "should not email new mentions with a watch level equal to or less than participant" do
|
it 'does not email new mentions with a watch level equal to or less than participant' do
|
||||||
send_notifications(@u_participating, @u_mentioned)
|
send_notifications(@u_participating, @u_mentioned)
|
||||||
expect(ActionMailer::Base.deliveries).to eq []
|
expect(ActionMailer::Base.deliveries).to be_empty
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -798,12 +798,12 @@ describe NotificationService, services: true do
|
||||||
notification.new_mentions_in_merge_request(merge_request, new_mentions, @u_disabled)
|
notification.new_mentions_in_merge_request(merge_request, new_mentions, @u_disabled)
|
||||||
end
|
end
|
||||||
|
|
||||||
it "should not email anyone unless they are newly mentioned" do
|
it 'sends no emails when there are no new mentions' do
|
||||||
send_notifications
|
send_notifications
|
||||||
expect(ActionMailer::Base.deliveries).to eq []
|
expect(ActionMailer::Base.deliveries).to be_empty
|
||||||
end
|
end
|
||||||
|
|
||||||
it "should email new mentions with a watch level higher than participant" do
|
it 'emails new mentions with a watch level higher than participant' do
|
||||||
send_notifications(@u_watcher, @u_participant_mentioned, @u_custom_global)
|
send_notifications(@u_watcher, @u_participant_mentioned, @u_custom_global)
|
||||||
|
|
||||||
should_email(@u_watcher)
|
should_email(@u_watcher)
|
||||||
|
@ -813,9 +813,9 @@ describe NotificationService, services: true do
|
||||||
expect(ActionMailer::Base.deliveries.count).to eq 3
|
expect(ActionMailer::Base.deliveries.count).to eq 3
|
||||||
end
|
end
|
||||||
|
|
||||||
it "should not email new mentions with a watch level equal to or less than participant" do
|
it 'does not email new mentions with a watch level equal to or less than participant' do
|
||||||
send_notifications(@u_participating, @u_mentioned)
|
send_notifications(@u_participating, @u_mentioned)
|
||||||
expect(ActionMailer::Base.deliveries).to eq []
|
expect(ActionMailer::Base.deliveries).to be_empty
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue