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
|
||||
|
|
|
|||
|
|
@ -8,7 +8,9 @@ FactoryGirl.define do
|
|||
timezone 'Amsterdam'
|
||||
contact_email 'admin@example.com'
|
||||
start_date Date.today
|
||||
end_date Date.tomorrow
|
||||
end_date Date.today + 6.days
|
||||
registration_start_date Date.today + 3.days
|
||||
registration_end_date Date.today + 5.days
|
||||
make_conference_public true
|
||||
venue
|
||||
end
|
||||
|
|
|
|||
|
|
@ -8,8 +8,10 @@ FactoryGirl.define do
|
|||
send_on_confirmed_without_registration false
|
||||
send_on_updated_conference_dates true
|
||||
send_on_updated_conference_registration_dates true
|
||||
updated_conference_dates_template 'Sample Conference\n New Dates: January 17 - 21 2014'
|
||||
updated_conference_dates_subject 'Conference dates have been updated'
|
||||
updated_conference_registration_dates_subject 'Conference registration dates have been updated'
|
||||
updated_conference_registration_dates_template 'Sample Conference\n New Dates: January 17 - 21 2014'
|
||||
registration_subject 'Lorem Ipsum Dolsum'
|
||||
registration_email_template 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit'
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue