require 'test_helper' class QuestionTest < ActionMailer::TestCase test "deliver" do mail = Question.deliver assert_equal "Deliver", mail.subject assert_equal ["to@example.org"], mail.to assert_equal ["from@example.com"], mail.from assert_match "Hi", mail.body.encoded end test "confirm" do mail = Question.confirm assert_equal "Confirm", mail.subject assert_equal ["to@example.org"], mail.to assert_equal ["from@example.com"], mail.from assert_match "Hi", mail.body.encoded end test "answer" do mail = Question.answer assert_equal "Answer", mail.subject assert_equal ["to@example.org"], mail.to assert_equal ["from@example.com"], mail.from assert_match "Hi", mail.body.encoded end end