agenda-libre-ruby/test/mailers/previews/moderation_mailer_preview.rb

33 lines
1.1 KiB
Ruby
Raw Normal View History

2014-06-09 12:18:40 +02:00
require 'differ'
# Preview all emails at http://localhost:3000/rails/mailers/moderation_mailer
class ModerationMailerPreview < ActionMailer::Preview
# Preview this email at http://localhost:3000/rails/mailers/moderation_mailer/create
def create
ActionMailer::Base.default_url_options[:host] = 'localhost:3000'
2014-07-01 15:50:39 +02:00
ModerationMailer.create Event.last
2014-06-09 12:18:40 +02:00
end
# Preview this email at http://localhost:3000/rails/mailers/moderation_mailer/update
def update
ActionMailer::Base.default_url_options[:host] = 'localhost:3000'
event = Event.last
event.description = event.description + '
hello world'
2014-07-01 15:50:39 +02:00
ModerationMailer.update event, User.last
2014-06-09 12:18:40 +02:00
end
2014-07-01 15:50:39 +02:00
# Preview this email at http://localhost:3000/rails/mailers/moderation_mailer/accept
def accept
2014-06-09 12:18:40 +02:00
ActionMailer::Base.default_url_options[:host] = 'localhost:3000'
2014-07-01 15:50:39 +02:00
ModerationMailer.accept Event.last, User.last
end
# Preview this email at http://localhost:3000/rails/mailers/moderation_mailer/destroy
def destroy
ActionMailer::Base.default_url_options[:host] = 'localhost:3000'
@reason = 'pas cool'
ModerationMailer.destroy Event.last, User.last, @reason
2014-06-09 12:18:40 +02:00
end
end