summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorjomo <github@jomo.tv>2014-07-06 04:57:51 +0200
committerjomo <github@jomo.tv>2014-07-06 04:57:51 +0200
commitb1d797ce0605264c5ebe57f9d465817a06b1fdf7 (patch)
treee499eea3ec2dd24ac570bdffec5bcdf63ef8cbf2 /test
parent2b1e8acee30d5aba5479e49fe5561db6ec081c7d (diff)
mentioning
Diffstat (limited to 'test')
-rw-r--r--test/mailers/previews/all_preview.rb63
-rw-r--r--test/mailers/previews/registration_preview.rb37
2 files changed, 63 insertions, 37 deletions
diff --git a/test/mailers/previews/all_preview.rb b/test/mailers/previews/all_preview.rb
new file mode 100644
index 0000000..d71268e
--- /dev/null
+++ b/test/mailers/previews/all_preview.rb
@@ -0,0 +1,63 @@
+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")
+
+ 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_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)")
+ 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...")
+ 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...")
+ 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**!")
+ 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...")
+ comment = Comment.new(id: 312, user_author: @@user, content: "Wow, that is **cool**!", blogpost: post)
+ RedstonerMailer.new_post_comment_mail(@@user, comment)
+ end
+
+ def new_post_comment_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: "You should not see this...")
+ comment = Comment.new(id: 312, user_author: @@user, content: "@mention 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 \ No newline at end of file
diff --git a/test/mailers/previews/registration_preview.rb b/test/mailers/previews/registration_preview.rb
deleted file mode 100644
index a7e9443..0000000
--- a/test/mailers/previews/registration_preview.rb
+++ /dev/null
@@ -1,37 +0,0 @@
-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 \ No newline at end of file