Sha256: a020c2b403890f7704ca307716829039fc92775480fa96a1ef1d7a6d67eb09a5

Contents?: true

Size: 839 Bytes

Versions: 5

Compression:

Stored size: 839 Bytes

Contents

Given /^"([^"]*)" subscribes to "([^"]*)"$/ do |name, list|
  user = NEWSLETTRE_CONFIG['users'][name]

  newslettre.lists.get(list).emails.add user
end

When /^I schedule "([^"]*)" for "([^"]*)"$/ do |letter, date|
  time = Chronic.parse date
  newslettre.newsletters.get(letter).schedule! :at => time
end

Then /^it should deliver "([^"]*)" at "([^"]*)"$/ do |letter, date|
  newslettre.newsletters.get(letter).schedule.should == Chronic.parse(date)
end

Given /^"([^"]*)" is not scheduled$/ do |letter|
  begin
    newslettre.newsletters.get(letter).deschedule!
  rescue Newslettre::API::ClientFailure
    nil
  end
end

When /^I deschedule "([^"]*)"$/ do |letter|
  newslettre.newsletters.get(letter).deschedule!
end

Then /^it should not deliver "([^"]*)"$/ do |letter|
  newslettre.newsletters.get(letter).should_not be_scheduled
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
newslettre-0.2.4 features/step_definitions/scheduling_steps.rb
newslettre-0.2.3 features/step_definitions/scheduling_steps.rb
newslettre-0.2.2 features/step_definitions/scheduling_steps.rb
newslettre-0.2.1 features/step_definitions/scheduling_steps.rb
newslettre-0.2.0 features/step_definitions/scheduling_steps.rb