mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Added test for email notification on conference dates and registration dates updates
This commit is contained in:
parent
6d847547b7
commit
8acf3c088a
3 changed files with 25 additions and 2 deletions
|
|
@ -21,7 +21,6 @@ describe Admin::ConferenceController do
|
|||
it 'locates the requested conference' do
|
||||
patch :update, id: conference.short_title, conference:
|
||||
attributes_for(:conference, title: 'Example Con')
|
||||
|
||||
expect(assigns(:conference)).to eq(conference)
|
||||
end
|
||||
|
||||
|
|
@ -42,6 +41,26 @@ describe Admin::ConferenceController do
|
|||
expect(response).to redirect_to edit_admin_conference_path(
|
||||
conference.short_title)
|
||||
end
|
||||
|
||||
it 'sends email notification on conference date update' do
|
||||
mailer = double
|
||||
allow(mailer).to receive(:deliver)
|
||||
conference.email_settings = create(:email_settings)
|
||||
patch :update, id: conference.short_title, conference:
|
||||
attributes_for(:conference, start_date: Date.today + 2.days, end_date: Date.today + 4.days)
|
||||
conference.reload
|
||||
allow(Mailbot).to receive(:conference_date_update_mail).and_return(mailer)
|
||||
end
|
||||
|
||||
it 'sends email notification on conference registration date update' do
|
||||
mailer = double
|
||||
allow(mailer).to receive(:deliver)
|
||||
conference.email_settings = create(:email_settings)
|
||||
patch :update, id: conference.short_title, conference:
|
||||
attributes_for(:conference, registration_start_date: Date.today + 2.days, registration_end_date: Date.today + 4.days)
|
||||
conference.reload
|
||||
allow(Mailbot).to receive(:conference_registration_date_update_mail).and_return(mailer)
|
||||
end
|
||||
end
|
||||
|
||||
context 'invalid attributes' do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue