Added tests for emails views specs for addition of settings

This commit is contained in:
Gopesh Tulsyan 2014-07-15 19:20:24 +05:30
parent 5baeee9ee8
commit b504db3372
3 changed files with 8 additions and 4 deletions

View file

@ -7,8 +7,7 @@ class EmailSettings < ActiveRecord::Base
:send_on_updated_conference_dates, :updated_conference_dates_subject, :send_on_updated_conference_dates, :updated_conference_dates_subject,
:updated_conference_dates_template, :send_on_updated_conference_registration_dates, :updated_conference_dates_template, :send_on_updated_conference_registration_dates,
:updated_conference_registration_dates_subject, :updated_conference_registration_dates_template, :updated_conference_registration_dates_subject, :updated_conference_registration_dates_template,
:send_on_venue_update, :send_on_venue_update, :venue_update_subject, :venue_update_template
:venue_update_subject, :venue_update_template
def get_values(conference, user, event = nil) def get_values(conference, user, event = nil)
h = { h = {

View file

@ -12,6 +12,9 @@ FactoryGirl.define do
updated_conference_dates_subject 'Conference dates have been updated' updated_conference_dates_subject 'Conference dates have been updated'
updated_conference_registration_dates_subject 'Conference registration 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' updated_conference_registration_dates_template 'Sample Conference\n New Dates: January 17 - 21 2014'
send_on_venue_update true
venue_update_subject "Venue has been updated"
venue_update_template "Venue has been Updated to Sample Location"
registration_subject 'Lorem Ipsum Dolsum' registration_subject 'Lorem Ipsum Dolsum'
registration_email_template 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit' registration_email_template 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit'
end end

View file

@ -8,9 +8,9 @@ describe 'admin/emails/index' do
assign :settings, @settings assign :settings, @settings
render render
expect(rendered). expect(rendered).
to have_selector("input[type='checkbox'][value='1']", count: 6) to have_selector("input[type='checkbox'][value='1']", count: 7)
expect(rendered). expect(rendered).
to have_selector("input[checked='checked'][type='checkbox'][value='1']", count: 3) to have_selector("input[checked='checked'][type='checkbox'][value='1']", count: 4)
expect(rendered).to include('Lorem Ipsum Dolsum') expect(rendered).to include('Lorem Ipsum Dolsum')
expect(rendered). expect(rendered).
to include('Lorem ipsum dolor sit amet, consectetuer adipiscing elit') to include('Lorem ipsum dolor sit amet, consectetuer adipiscing elit')
@ -18,5 +18,7 @@ describe 'admin/emails/index' do
to include('Conference dates have been updated') to include('Conference dates have been updated')
expect(rendered). expect(rendered).
to include('Conference registration dates have been updated') to include('Conference registration dates have been updated')
expect(rendered).to include("Venue has been updated")
expect(rendered).to include("Venue has been Updated to Sample Location")
end end
end end