summaryrefslogtreecommitdiff
path: root/test/mailers/previews/registration_preview.rb
blob: a7e94435484617edd4cd0d8c177cf01916f22415 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
class RegistrationPreview < ActionMailer::Preview
  @@user = User.new(id: 123, uuid: "aabbccddeeff11223344556677889900", ign: "fancy_user", name: "fancy_user", email_token: "abcdefg", email: "fancymail@example.com", created_at: Time.now, last_ip: "1.2.3.4")

  def register_mail_normal
    RedstonerMailer.register_mail(@@user, false)
  end

  def register_mail_idiot
    RedstonerMailer.register_mail(@@user, true)
  end

  def register_info_mail_normal
    RedstonerMailer.register_info_mail(@@user, false)
  end

  def register_info_mail_idiot
    RedstonerMailer.register_info_mail(@@user, true)
  end

  def new_thread_reply_mail
    op     = User.new(id: 32, name: "TheOP", email: "theopuser@example.com")
    thread = Forumthread.new(id: 123, user_author: op, title: "Wow, test thread!", content: "You should not see this...")
    reply  = Threadreply.new(id: 312, user_author: @@user, content: "# Markdown!\n\n`incline code`\n\n<b>html?</b>\n\n[yt:abcd1234]\n\n[link](/forums)", forumthread: thread)
    RedstonerMailer.new_thread_reply_mail(@@user, reply)
  end

  def new_post_comment_mail
    op      = User.new(id: 32, name: "TheOP", email: "theopuser@example.com")
    post    = Blogpost.new(id: 123, user_author: op, title: "Wow, test post!", content: "You should not see this...")
    comment = Comment.new(id: 312, user_author: @@user, content: "Wow, that is **cool**!", blogpost: post)
    RedstonerMailer.new_post_comment_mail(@@user, comment)
  end

  def email_change_confirm_mail
    RedstonerMailer.email_change_confirm_mail(@@user)
  end
end