diff options
Diffstat (limited to 'spec/views/notify/change_in_merge_request_draft_status_email.text.erb_spec.rb')
-rw-r--r-- | spec/views/notify/change_in_merge_request_draft_status_email.text.erb_spec.rb | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/spec/views/notify/change_in_merge_request_draft_status_email.text.erb_spec.rb b/spec/views/notify/change_in_merge_request_draft_status_email.text.erb_spec.rb index a05c20fd8c4..3faba483516 100644 --- a/spec/views/notify/change_in_merge_request_draft_status_email.text.erb_spec.rb +++ b/spec/views/notify/change_in_merge_request_draft_status_email.text.erb_spec.rb @@ -12,9 +12,19 @@ RSpec.describe 'notify/change_in_merge_request_draft_status_email.text.erb' do it_behaves_like 'renders plain text email correctly' - it 'renders the email correctly' do + it 'shows user added draft status on email' do + merge_request.update!(title: merge_request.draft_title) + + render + + expect(merge_request.draft).to be_truthy + expect(rendered).to have_content("#{user.name} marked merge request #{merge_request.to_reference} as draft") + end + + it 'shows user removed draft status on email' do render - expect(rendered).to have_content("#{user.name} changed the draft status of merge request #{merge_request.to_reference}") + expect(merge_request.draft).to be_falsy + expect(rendered).to have_content("#{user.name} marked merge request #{merge_request.to_reference} as ready") end end |