Skip to content

Commit

Permalink
lint a random file (#3098)
Browse files Browse the repository at this point in the history
  • Loading branch information
osc-bot authored Oct 4, 2023
1 parent f9f6438 commit 5a417a1
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions apps/dashboard/test/mailers/support_ticket_mailer_test.rb
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
require "test_helper"
# frozen_string_literal: true

class SupportTicketMailerTest < ActionMailer::TestCase
require 'test_helper'

class SupportTicketMailerTest < ActionMailer::TestCase
def setup
@support_ticket = SupportTicket.from_config({})
@support_ticket.attributes = {
email: "[email protected]",
cc: "[email protected]",
subject: "email subject",
email: '[email protected]',
cc: '[email protected]',
subject: 'email subject'
}
@context = OpenStruct.new({
support_ticket: @support_ticket,
})
support_ticket: @support_ticket
})
end

test 'generates email with all expected fields' do
support_ticket_config = {
email: {
to: "[email protected]",
to: '[email protected]'
}
}
email = SupportTicketMailer.support_email(support_ticket_config, @context)
Expand All @@ -26,19 +27,19 @@ def setup
email.deliver_now
end

assert_equal ["[email protected]"], email.from
assert_equal ["[email protected]"], email.to
assert_equal ["[email protected]"], email.reply_to
assert_equal ["[email protected]"], email.cc
assert_equal "email subject", email.subject
assert_equal ['[email protected]'], email.from
assert_equal ['[email protected]'], email.to
assert_equal ['[email protected]'], email.reply_to
assert_equal ['[email protected]'], email.cc
assert_equal 'email subject', email.subject
assert_match 'Support ticket submitted from the dashboard application', email.body.encoded
end

test 'from address can be overridden with configuration' do
support_ticket_config = {
email: {
from: "[email protected]",
to: "[email protected]",
from: '[email protected]',
to: '[email protected]'
}
}
email = SupportTicketMailer.support_email(support_ticket_config, @context)
Expand All @@ -47,7 +48,6 @@ def setup
email.deliver_now
end

assert_equal ["[email protected]"], email.from
assert_equal ['[email protected]'], email.from
end

end
end

0 comments on commit 5a417a1

Please sign in to comment.