saucy 0.2.34 → 0.2.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/saucy/account.rb +1 -1
- data/spec/models/account_spec.rb +6 -2
- metadata +3 -3
data/lib/saucy/account.rb
CHANGED
@@ -91,7 +91,7 @@ module Saucy
|
|
91
91
|
includes(:plan).
|
92
92
|
where(:plans => { :trial => true }).
|
93
93
|
where(:notified_of_expiration => false).
|
94
|
-
where(["accounts.
|
94
|
+
where(["accounts.trial_expires_at <= ?", 7.days.from_now])
|
95
95
|
end
|
96
96
|
|
97
97
|
def new_unactivated
|
data/spec/models/account_spec.rb
CHANGED
@@ -105,14 +105,18 @@ describe Account do
|
|
105
105
|
trial = Factory(:plan, :trial => true)
|
106
106
|
forever = Factory(:plan, :trial => false)
|
107
107
|
|
108
|
-
|
109
|
-
|
108
|
+
created_23_days = Factory(:account, :plan => trial, :created_at => 23.days.ago)
|
109
|
+
expires_7_days = Factory(:account, :plan => trial, :created_at => 1.day.ago)
|
110
|
+
expiring = [created_23_days, expires_7_days]
|
110
111
|
forever = Factory(:account, :plan => forever, :created_at => 23.days.ago)
|
111
112
|
new_trial = Factory(:account, :plan => trial, :created_at => 22.days.ago)
|
112
113
|
already_notified = Factory(:account, :plan => trial,
|
113
114
|
:created_at => 24.days.ago,
|
114
115
|
:notified_of_expiration => true)
|
115
116
|
|
117
|
+
expires_7_days.trial_expires_at = 7.days.from_now
|
118
|
+
expires_7_days.save!
|
119
|
+
|
116
120
|
mail = stub('mail', :deliver => true)
|
117
121
|
BillingMailer.stubs(:expiring_trial => mail)
|
118
122
|
|
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:
|
4
|
+
hash: 81
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 35
|
10
|
+
version: 0.2.35
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- thoughtbot, inc.
|