Sha256: 1e36fd475d3fd2a81e0fd7ac8fc2b846510a47035686599388d5971c629aa0a6

Contents?: true

Size: 845 Bytes

Versions: 7

Compression:

Stored size: 845 Bytes

Contents

# -*- encoding : utf-8 -*-
require File.expand_path(File.join(File.dirname(__FILE__), "..", "support", "paths"))

Given /^(.*) (is|am) watching "([^\"]+)"$/ do |user, verb, cardname|
  user = Account.current.name if user == "I"
  step "the card #{cardname}+*watchers contains \"[[#{user}]]\""
end

Then /^(.*) should be notified that "(.*)"$/ do |username, subject|
  card_with_acct = username=='I' ? Account.current : Card[username]
  email = card_with_acct.account.email

  begin
    step %{"#{email}" should receive 1 email}
  rescue RSpec::Expectations::ExpectationNotMetError=>e
    raise RSpec::Expectations::ExpectationNotMetError, "#{e.message}\n Found the following emails:\n\n #{all_emails.to_s}"
  end
  open_email(email, :with_subject => /#{subject}/)
end

Then /^No notification should be sent$/ do
  all_emails.should be_empty
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
wagn-1.12.13 features/step_definitions/notification_steps.rb
wagn-1.12.12 features/step_definitions/notification_steps.rb
wagn-1.12.11 features/step_definitions/notification_steps.rb
wagn-1.12.10 features/step_definitions/notification_steps.rb
wagn-1.12.9 features/step_definitions/notification_steps.rb
wagn-1.12.8 features/step_definitions/notification_steps.rb
wagn-1.12.7 features/step_definitions/notification_steps.rb