tests: add more controller tests.

* Fix an exception in /artists/show_or_new.
This commit is contained in:
evazion
2020-03-31 17:46:45 -05:00
parent a272453bd0
commit e0a72ef135
9 changed files with 131 additions and 1 deletions

View File

@@ -0,0 +1,38 @@
require "test_helper"
class UserMailerTest < ActionMailer::TestCase
context "UserMailer" do
setup do
@user = create(:user, email_address: build(:email_address))
end
context "dmail_notice method" do
should "work" do
@dmail = create(:dmail, owner: @user, to: @user)
mail = UserMailer.dmail_notice(@dmail)
assert_emails(1) { mail.deliver_now }
end
end
context "password_reset method" do
should "work" do
mail = UserMailer.password_reset(@user)
assert_emails(1) { mail.deliver_now }
end
end
context "email_change_confirmation method" do
should "work" do
mail = UserMailer.email_change_confirmation(@user)
assert_emails(1) { mail.deliver_now }
end
end
context "welcome_user method" do
should "work" do
mail = UserMailer.welcome_user(@user)
assert_emails(1) { mail.deliver_now }
end
end
end
end