Sha256: 58c29e9cade39d974161de77f951d3bdf3f35b277d176e0b7f5225f8a0680b3b

Contents?: true

Size: 1.42 KB

Versions: 1

Compression:

Stored size: 1.42 KB

Contents

# this file generated by script/generate pickle email

ActionMailer::Base.delivery_method = :test
ActionMailer::Base.perform_deliveries = true

Before do
  ActionMailer::Base.deliveries.clear
end

Given(/^all emails? (?:have|has) been delivered$/) do
  ActionMailer::Base.deliveries.clear
end

Given(/^(\d)+ emails? should be delivered$/) do |count|
  emails.size.should == count.to_i
end

Then(/^(\d)+ emails? should be delivered to (.*)$/) do |count, to|
  to =~ /^#{capture_model}$/ && to = model($1).email
  emails("to: \"#{to}\"").size.should == count.to_i
end

Then(/^(\d)+ emails? should be delivered with #{capture_fields}$/) do |count, fields|
  emails(fields).size.should == count.to_i
end

Then(/^#{capture_email} should be delivered to (.+)$/) do |email_ref, to|
  to =~ /^#{capture_model}$/ && to = model($1).email
  email(email_ref, "to: \"#{to}\"").should_not be_nil
end

Then(/^#{capture_email} should have #{capture_fields}$/) do |email_ref, fields|
  email(email_ref, fields).should_not be_nil
end

Then(/^#{capture_email} should contain "(.*)"$/) do |email_ref, text|
  email(email_ref).body.should =~ /#{text}/
end

Then(/^#{capture_email} should not contain "(.*)"$/) do |email_ref, text|
  email(email_ref).body.should_not =~ /#{text}/
end

Then(/^#{capture_email} should link to (.+) page$/) do |email_ref, page|
  email(email_ref).body.should =~ /#{page_to_path(page)}/
end

Then(/^show me the emails?$/) do
   save_and_open_emails
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ianwhite-pickle-0.1.6 rails_generators/pickle/templates/pickle_email_steps.rb