saucy 0.2.33 → 0.2.34

Sign up to get free protection for your applications and to get access to all the features.
@@ -20,7 +20,7 @@ class BillingMailer < ActionMailer::Base
20
20
 
21
21
  def expiring_trial(account)
22
22
  @account = account
23
- mail(:to => account.customer.email,
23
+ mail(:to => account.admin_emails,
24
24
  :subject => I18n.t(:subject,
25
25
  :scope => [:billing_mailer, :expiring_trial],
26
26
  :default => "Your trial is expiring soon"),
@@ -56,13 +56,12 @@ Feature: Trial plans
56
56
  And I should not see "expired"
57
57
 
58
58
  Scenario: Receive a reminder about an expiring trial plan
59
- Given the following account exists:
60
- | plan | name | billing email |
61
- | name: Temp | Test | admin@example.com |
62
- And the "Test" account was created 23 days ago
63
- And I am signed in as an admin of the "Test" account
59
+ Given a "Temp" account exists with a name of "Test" created 23 days ago
60
+ And a user exists with an email of "admin@example.com"
61
+ And "admin@example.com" is an admin of the "Test" account
64
62
  When the daily Saucy jobs are processed
65
- And I follow the link sent to "admin@example.com"
63
+ And I sign in as "admin@example.com"
64
+ And I follow the link sent to "admin@example.com" with subject "Your trial is expiring soon"
66
65
  Then I should be on the upgrade plan page for the "Test" account
67
66
 
68
67
  Scenario: Receive a reminder about setting up an account
@@ -11,6 +11,23 @@ When /^I follow the link sent to "([^"]+)"$/ do |email_address|
11
11
  visit url
12
12
  end
13
13
 
14
+ When /^I follow the link sent to "([^"]+)" with subject "([^"]+)"$/ do |email_address, subject|
15
+ to_address = ActionMailer::Base.deliveries.select do |tmail|
16
+ tmail.to.include?(email_address)
17
+ end or raise "No email sent to #{email_address}"
18
+
19
+ email = to_address.detect do |tmail|
20
+ tmail.subject.include?(subject)
21
+ end or raise "No email sent to #{email_address} with subject #{subject}"
22
+
23
+ unless match = email.body.match(%r{http://\S+})
24
+ raise "No link included in the email:\n#{email.body}"
25
+ end
26
+ url = match[0]
27
+
28
+ visit url
29
+ end
30
+
14
31
  Then /^an email with subject "([^"]*)" should be sent to "([^"]*)"$/ do |subject, to_address|
15
32
  email = ActionMailer::Base.deliveries.detect do |tmail|
16
33
  tmail.subject.include?(subject)
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: saucy
3
3
  version: !ruby/object:Gem::Version
4
- hash: 85
4
+ hash: 83
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 33
10
- version: 0.2.33
9
+ - 34
10
+ version: 0.2.34
11
11
  platform: ruby
12
12
  authors:
13
13
  - thoughtbot, inc.