summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorjomo <github@jomo.tv>2015-02-08 01:25:15 +0100
committerjomo <github@jomo.tv>2015-02-08 01:25:15 +0100
commitf428bb3a359e241f67d2da398508cd1ec57aae8e (patch)
tree325478ac6727762125508b4cf16295ad3ecc25ae /test
parent05760b845cd95b8e6e3a414f2a7a877df0994362 (diff)
fix mailer previews
Diffstat (limited to 'test')
-rw-r--r--test/mailers/previews/all_preview.rb16
1 files changed, 6 insertions, 10 deletions
diff --git a/test/mailers/previews/all_preview.rb b/test/mailers/previews/all_preview.rb
index b2370d9..2af99f0 100644
--- a/test/mailers/previews/all_preview.rb
+++ b/test/mailers/previews/all_preview.rb
@@ -1,5 +1,6 @@
class AllPreview < 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")
+ @@op = User.new(id: 32, name: "TheOP", ign: "the_op", email: "theopuser@example.com")
def register_mail_normal
RedstonerMailer.register_mail(@@user, false)
@@ -18,34 +19,29 @@ class AllPreview < ActionMailer::Preview
end
def new_thread_mention_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: "# Markdown!\n\n@mention\n`incline code`\n\n<b>html?</b>\n\n[yt:abcd1234]\n\n[link](/forums)")
+ thread = Forumthread.new(id: 123, user_author: @@op, title: "Wow, test thread!", content: "# Markdown!\n\n@mention\n`incline code`\n\n<b>html?</b>\n\n[yt:abcd1234]\n\n[link](/forums)")
RedstonerMailer.new_thread_mention_mail(@@user, thread)
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...")
+ 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_thread_reply_mention_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...")
+ 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@mention\n`incline code`\n\n<b>html?</b>\n\n[yt:abcd1234]\n\n[link](/forums)", forumthread: thread)
RedstonerMailer.new_thread_reply_mention_mail(@@user, reply)
end
def new_post_mention_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: "@mention Wow, that is **cool**!")
+ post = Blogpost.new(id: 123, user_author: @@op, title: "Wow, test post!", content: "@mention Wow, that is **cool**!")
RedstonerMailer.new_post_mention_mail(@@user, post)
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...")
+ 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