Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SAW - Mailer specs fixed #2080

Merged
merged 1 commit into from
Dec 5, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion spec/support/emails/tables.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

module EmailHelpers
include ApplicationHelper
include ActionView::Helpers::TagHelper
include ActionView::Context

def assert_email_project_information(mail_response)
#assert correct protocol information is included in notification email
Expand Down Expand Up @@ -178,7 +180,9 @@ def assert_email_note_information(mail)
expect(mail).to have_xpath "//th[text()='#{I18n.t(:notifier)[:note_user]}']/following-sibling::th[text()='#{I18n.t(:notifier)[:note_date]}']/following-sibling::th[text()='#{I18n.t(:notifier)[:note]}']"

@protocol.notes.each do |note|
expect(mail).to have_xpath "//td[text()=\"#{note.identity.full_name}\"]/following-sibling::td[text()='#{format_date(note.created_at)}']/following-sibling::td[text()='#{note.body}']"
expect(mail).to have_xpath "//td[text()=\"#{note.identity.full_name}\"]"
expect(mail).to have_xpath "//td/span[text()='#{ActionController::Base.helpers.strip_tags(format_date(note.created_at))}']"
expect(mail).to have_xpath "//td[text()='#{note.body}']"
end
else
expect(mail).to_not have_xpath "//table//th[text()='#{I18n.t('notifier.protocol_notes', type: @protocol.type)}']"
Expand Down