Sha256: 0803ca14ff49849a4772bd96f4b4224dc0f54f7e1c933ba53da737b5a64d2578

Contents?: true

Size: 1.42 KB

Versions: 31

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 (.+)$/) do |email_ref, page|
  email(email_ref).body.should =~ /#{path_to(page)}/
end

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

Version data entries

31 entries across 23 versions & 4 rubygems

Version Path
mail_manager-3.0.0 features/step_definitions/email_steps.rb
mail_manager-0.1.4 features/step_definitions/email_steps.rb
mail_manager-0.1.2 features/step_definitions/email_steps.rb
mail_manager-0.1.1 features/step_definitions/email_steps.rb
mail_manager-0.1.0 features/step_definitions/email_steps.rb
mail_manager-0.0.1 features/step_definitions/email_steps.rb
ianwhite-pickle-0.1.10 rails_generators/pickle/templates/email_steps.rb
ianwhite-pickle-0.1.11 rails_generators/pickle/templates/email_steps.rb
ianwhite-pickle-0.1.12 rails_generators/pickle/templates/email_steps.rb
ianwhite-pickle-0.1.13 rails_generators/pickle/templates/email_steps.rb
ianwhite-pickle-0.1.14 rails_generators/pickle/templates/email_steps.rb
ianwhite-pickle-0.1.15 rails_generators/pickle/templates/email_steps.rb
ianwhite-pickle-0.1.8 rails_generators/pickle/templates/email_steps.rb
ianwhite-pickle-0.1.9 rails_generators/pickle/templates/email_steps.rb
mrflip-pickle-0.1.13 rails_generators/pickle/templates/email_steps.rb
pickle-0.1.23 rails_generators/pickle/templates/email_steps.rb
pickle-0.1.23 features/step_definitions/email_steps.rb
pickle-0.1.22 rails_generators/pickle/templates/email_steps.rb
pickle-0.1.22 features/step_definitions/email_steps.rb
pickle-0.1.21 rails_generators/pickle/templates/email_steps.rb