Sha256: 135bdfcec436cd0426e9508ea051c02651ccececa03a01bd1c6ff50905d48804

Contents?: true

Size: 1.86 KB

Versions: 64

Compression:

Stored size: 1.86 KB

Contents

# this file generated by script/generate pickle email
#
# add email mappings in features/support/email.rb

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

Before do
  ActionMailer::Base.deliveries.clear
end

# Clear the deliveries array, useful if your background sends email that you want to ignore
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

When(/^(?:I|they) follow "([^"]*?)" in #{capture_email}$/) do |link, email_ref|
  visit_in_email(email(email_ref), link)
end

When(/^(?:I|they) click the first link in #{capture_email}$/) do |email_ref|
  click_first_link_in_email(email(email_ref))
end

Then(/^(\d)+ emails? should be delivered to (.*)$/) do |count, to|
  emails("to: \"#{email_for(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|
  email(email_ref, "to: \"#{email_for(to)}\"").should_not be_nil
end

Then(/^#{capture_email} should not be delivered to (.+)$/) do |email_ref, to|
  email(email_ref, "to: \"#{email_for(to)}\"").should 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

64 entries across 32 versions & 3 rubygems

Version Path
pickle-0.4.11 rails_generators/pickle/templates/email_steps.rb
pickle-0.4.11 features/step_definitions/email_steps.rb
pickle-0.4.10 rails_generators/pickle/templates/email_steps.rb
pickle-0.4.10 features/step_definitions/email_steps.rb
pickle-0.4.9 rails_generators/pickle/templates/email_steps.rb
pickle-0.4.9 features/step_definitions/email_steps.rb
pickle-0.4.8 features/step_definitions/email_steps.rb
pickle-0.4.8 rails_generators/pickle/templates/email_steps.rb
pickle-0.4.7 rails_generators/pickle/templates/email_steps.rb
pickle-0.4.7 features/step_definitions/email_steps.rb
pickle-0.4.6 rails_generators/pickle/templates/email_steps.rb
pickle-0.4.6 features/step_definitions/email_steps.rb
pickle-0.4.5 features/step_definitions/email_steps.rb
pickle-0.4.5 rails_generators/pickle/templates/email_steps.rb
pickle-0.4.4 features/step_definitions/email_steps.rb
pickle-0.4.4 rails_generators/pickle/templates/email_steps.rb
judit-pickle-0.4.2 features/step_definitions/email_steps.rb
judit-pickle-0.4.2 rails_generators/pickle/templates/email_steps.rb
pickle-0.4.3 features/step_definitions/email_steps.rb
pickle-0.4.3 rails_generators/pickle/templates/email_steps.rb