saucy 0.14.5 → 0.15.0

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -1,6 +1,8 @@
1
+ .bundle
1
2
  ~
2
3
  *.swp
3
4
  *.swo
4
5
  tmp
5
6
  pkg
6
7
  *.gem
8
+ tags
@@ -1,8 +1,15 @@
1
+ 0.15.0
2
+
3
+ * Signup accepts a "quick" flag that will cause existing users to sign in instead of creating a new account.
4
+
1
5
  0.14.5
2
6
 
3
7
  * Upgrade to clearance 0.14.0. (Motivated by getting rid of some redundant flashes)
4
8
  * Remove Account and Project creation flashes
5
9
 
10
+ With this release you will also want to regenerate the saucy features (`rails g saucy:features`), or look at the commit diffs and
11
+ introduce the above two changes yourself as they have been changed to account for certain flash messages no longer being present.
12
+
6
13
  0.14.3
7
14
 
8
15
  * Redirect to upgrade page if beyond limit
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- saucy (0.14.4)
4
+ saucy (0.15.0)
5
5
  airbrake (~> 3.0.4)
6
6
  braintree (>= 2.6.2)
7
7
  clearance (~> 0.14.0)
@@ -171,13 +171,13 @@ GEM
171
171
  rack
172
172
  shoulda-matchers (1.0.0)
173
173
  sinatra (1.3.2)
174
- rack (>= 1.3.6, ~> 1.3)
174
+ rack (~> 1.3, >= 1.3.6)
175
175
  rack-protection (~> 1.2)
176
- tilt (>= 1.3.3, ~> 1.3)
176
+ tilt (~> 1.3, >= 1.3.3)
177
177
  sprockets (2.0.3)
178
178
  hike (~> 1.2)
179
179
  rack (~> 1.0)
180
- tilt (!= 1.3.0, ~> 1.1)
180
+ tilt (~> 1.1, != 1.3.0)
181
181
  sqlite3 (1.3.4)
182
182
  term-ansicolor (1.0.7)
183
183
  thin (1.2.11)
@@ -29,7 +29,8 @@ class Signup
29
29
 
30
30
  attr_accessor :billing_email, :password, :cardholder_name, :email,
31
31
  :card_number, :expiration_month, :expiration_year, :plan, :verification_code, :coupon,
32
- :street_address, :extended_address, :locality, :region, :postal_code, :country_name
32
+ :street_address, :extended_address, :locality, :region, :postal_code, :country_name,
33
+ :quick
33
34
 
34
35
  def initialize(attributes = {})
35
36
  if attributes
@@ -69,7 +70,7 @@ class Signup
69
70
  end
70
71
 
71
72
  def account
72
- @account ||= Account.new
73
+ @account ||= existing_account_in_quick_mode || Account.new
73
74
  end
74
75
 
75
76
  def user
@@ -161,12 +162,30 @@ class Signup
161
162
  end
162
163
  end
163
164
 
165
+ def existing_account_in_quick_mode
166
+ if quick?
167
+ existing_account
168
+ end
169
+ end
170
+
171
+ def quick?
172
+ quick
173
+ end
174
+
175
+ def existing_account
176
+ if existing_user
177
+ existing_user.accounts.first
178
+ end
179
+ end
180
+
164
181
  def save!
165
182
  account.coupon = coupon
166
183
  Account.transaction do
167
184
  account.save!
168
185
  user.save!
169
- membership.save!
186
+ unless existing_account_in_quick_mode
187
+ membership.save!
188
+ end
170
189
  end
171
190
  end
172
191
  end
@@ -1,3 +1,3 @@
1
1
  module Saucy
2
- VERSION = '0.14.5'
2
+ VERSION = '0.15.0'
3
3
  end
@@ -152,7 +152,11 @@ describe Signup, "valid with a signed in user" do
152
152
  it_should_behave_like "valid signup"
153
153
  let!(:user) { Factory(:user) }
154
154
  subject { Factory.build(:signup, :user => user, :password => '') }
155
- before { @result = subject.save }
155
+
156
+ before do
157
+ Factory(:membership, :user => user)
158
+ @result = subject.save
159
+ end
156
160
 
157
161
  it "doesn't create a user" do
158
162
  User.count.should == 1
@@ -200,3 +204,40 @@ describe Signup, "with coupon" do
200
204
  subject.account.reload.coupon.should == coupon
201
205
  end
202
206
  end
207
+
208
+ describe Signup, "in quick mode with existing email" do
209
+ it_should_behave_like "valid signup"
210
+ let(:email) { "user@example.com" }
211
+ let(:password) { "test" }
212
+ let!(:account) { Factory(:account) }
213
+ let!(:user) { Factory(:user, :email => email, :password => password) }
214
+ subject { Factory.build(:signup, :email => email, :password => password, :quick => true) }
215
+
216
+ before do
217
+ Factory(:membership, :user => user, :account => account)
218
+ @result = subject.save
219
+ end
220
+
221
+ it "doesn't create a user" do
222
+ User.count.should == 1
223
+ end
224
+
225
+ it "uses the user's existing account" do
226
+ user.reload.accounts.should == [account]
227
+ end
228
+ end
229
+
230
+ describe Signup, "in quick mode with unknown email" do
231
+ it_should_behave_like "valid signup"
232
+ let(:email) { "user@example.com" }
233
+ subject { Factory.build(:signup, :email => email, :quick => true) }
234
+ before { @result = subject.save }
235
+
236
+ it "saves the user" do
237
+ subject.user.should be_persisted
238
+ end
239
+
240
+ it "assigns the user to a new account" do
241
+ subject.user.reload.accounts.should include(subject.account)
242
+ end
243
+ end
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: 45
4
+ hash: 35
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 14
9
- - 5
10
- version: 0.14.5
8
+ - 15
9
+ - 0
10
+ version: 0.15.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - thoughtbot, inc.
@@ -20,12 +20,10 @@ autorequire:
20
20
  bindir: bin
21
21
  cert_chain: []
22
22
 
23
- date: 2012-01-13 00:00:00 Z
23
+ date: 2012-01-28 00:00:00 Z
24
24
  dependencies:
25
25
  - !ruby/object:Gem::Dependency
26
- name: clearance
27
- prerelease: false
28
- requirement: &id001 !ruby/object:Gem::Requirement
26
+ version_requirements: &id001 !ruby/object:Gem::Requirement
29
27
  none: false
30
28
  requirements:
31
29
  - - ~>
@@ -36,12 +34,12 @@ dependencies:
36
34
  - 14
37
35
  - 0
38
36
  version: 0.14.0
37
+ requirement: *id001
39
38
  type: :runtime
40
- version_requirements: *id001
41
- - !ruby/object:Gem::Dependency
42
- name: formtastic
43
39
  prerelease: false
44
- requirement: &id002 !ruby/object:Gem::Requirement
40
+ name: clearance
41
+ - !ruby/object:Gem::Dependency
42
+ version_requirements: &id002 !ruby/object:Gem::Requirement
45
43
  none: false
46
44
  requirements:
47
45
  - - ~>
@@ -52,12 +50,12 @@ dependencies:
52
50
  - 2
53
51
  - 4
54
52
  version: 1.2.4
53
+ requirement: *id002
55
54
  type: :runtime
56
- version_requirements: *id002
57
- - !ruby/object:Gem::Dependency
58
- name: railties
59
55
  prerelease: false
60
- requirement: &id003 !ruby/object:Gem::Requirement
56
+ name: formtastic
57
+ - !ruby/object:Gem::Dependency
58
+ version_requirements: &id003 !ruby/object:Gem::Requirement
61
59
  none: false
62
60
  requirements:
63
61
  - - ">="
@@ -68,12 +66,12 @@ dependencies:
68
66
  - 0
69
67
  - 3
70
68
  version: 3.0.3
69
+ requirement: *id003
71
70
  type: :runtime
72
- version_requirements: *id003
73
- - !ruby/object:Gem::Dependency
74
- name: braintree
75
71
  prerelease: false
76
- requirement: &id004 !ruby/object:Gem::Requirement
72
+ name: railties
73
+ - !ruby/object:Gem::Dependency
74
+ version_requirements: &id004 !ruby/object:Gem::Requirement
77
75
  none: false
78
76
  requirements:
79
77
  - - ">="
@@ -84,12 +82,12 @@ dependencies:
84
82
  - 6
85
83
  - 2
86
84
  version: 2.6.2
85
+ requirement: *id004
87
86
  type: :runtime
88
- version_requirements: *id004
89
- - !ruby/object:Gem::Dependency
90
- name: sham_rack
91
87
  prerelease: false
92
- requirement: &id005 !ruby/object:Gem::Requirement
88
+ name: braintree
89
+ - !ruby/object:Gem::Dependency
90
+ version_requirements: &id005 !ruby/object:Gem::Requirement
93
91
  none: false
94
92
  requirements:
95
93
  - - "="
@@ -100,12 +98,12 @@ dependencies:
100
98
  - 3
101
99
  - 3
102
100
  version: 1.3.3
101
+ requirement: *id005
103
102
  type: :runtime
104
- version_requirements: *id005
105
- - !ruby/object:Gem::Dependency
106
- name: sinatra
107
103
  prerelease: false
108
- requirement: &id006 !ruby/object:Gem::Requirement
104
+ name: sham_rack
105
+ - !ruby/object:Gem::Dependency
106
+ version_requirements: &id006 !ruby/object:Gem::Requirement
109
107
  none: false
110
108
  requirements:
111
109
  - - ">="
@@ -116,12 +114,12 @@ dependencies:
116
114
  - 1
117
115
  - 2
118
116
  version: 1.1.2
117
+ requirement: *id006
119
118
  type: :runtime
120
- version_requirements: *id006
121
- - !ruby/object:Gem::Dependency
122
- name: airbrake
123
119
  prerelease: false
124
- requirement: &id007 !ruby/object:Gem::Requirement
120
+ name: sinatra
121
+ - !ruby/object:Gem::Dependency
122
+ version_requirements: &id007 !ruby/object:Gem::Requirement
125
123
  none: false
126
124
  requirements:
127
125
  - - ~>
@@ -132,12 +130,12 @@ dependencies:
132
130
  - 0
133
131
  - 4
134
132
  version: 3.0.4
133
+ requirement: *id007
135
134
  type: :runtime
136
- version_requirements: *id007
137
- - !ruby/object:Gem::Dependency
138
- name: aruba
139
135
  prerelease: false
140
- requirement: &id008 !ruby/object:Gem::Requirement
136
+ name: airbrake
137
+ - !ruby/object:Gem::Dependency
138
+ version_requirements: &id008 !ruby/object:Gem::Requirement
141
139
  none: false
142
140
  requirements:
143
141
  - - ~>
@@ -147,12 +145,12 @@ dependencies:
147
145
  - 0
148
146
  - 4
149
147
  version: "0.4"
148
+ requirement: *id008
150
149
  type: :development
151
- version_requirements: *id008
152
- - !ruby/object:Gem::Dependency
153
- name: shoulda-matchers
154
150
  prerelease: false
155
- requirement: &id009 !ruby/object:Gem::Requirement
151
+ name: aruba
152
+ - !ruby/object:Gem::Dependency
153
+ version_requirements: &id009 !ruby/object:Gem::Requirement
156
154
  none: false
157
155
  requirements:
158
156
  - - ~>
@@ -163,12 +161,12 @@ dependencies:
163
161
  - 0
164
162
  - 0
165
163
  version: 1.0.0
164
+ requirement: *id009
166
165
  type: :development
167
- version_requirements: *id009
168
- - !ruby/object:Gem::Dependency
169
- name: bourne
170
166
  prerelease: false
171
- requirement: &id010 !ruby/object:Gem::Requirement
167
+ name: shoulda-matchers
168
+ - !ruby/object:Gem::Dependency
169
+ version_requirements: &id010 !ruby/object:Gem::Requirement
172
170
  none: false
173
171
  requirements:
174
172
  - - ">="
@@ -177,12 +175,12 @@ dependencies:
177
175
  segments:
178
176
  - 0
179
177
  version: "0"
178
+ requirement: *id010
180
179
  type: :development
181
- version_requirements: *id010
182
- - !ruby/object:Gem::Dependency
183
- name: sqlite3
184
180
  prerelease: false
185
- requirement: &id011 !ruby/object:Gem::Requirement
181
+ name: bourne
182
+ - !ruby/object:Gem::Dependency
183
+ version_requirements: &id011 !ruby/object:Gem::Requirement
186
184
  none: false
187
185
  requirements:
188
186
  - - ">="
@@ -191,12 +189,12 @@ dependencies:
191
189
  segments:
192
190
  - 0
193
191
  version: "0"
192
+ requirement: *id011
194
193
  type: :development
195
- version_requirements: *id011
196
- - !ruby/object:Gem::Dependency
197
- name: factory_girl
198
194
  prerelease: false
199
- requirement: &id012 !ruby/object:Gem::Requirement
195
+ name: sqlite3
196
+ - !ruby/object:Gem::Dependency
197
+ version_requirements: &id012 !ruby/object:Gem::Requirement
200
198
  none: false
201
199
  requirements:
202
200
  - - ">="
@@ -205,12 +203,12 @@ dependencies:
205
203
  segments:
206
204
  - 0
207
205
  version: "0"
206
+ requirement: *id012
208
207
  type: :development
209
- version_requirements: *id012
210
- - !ruby/object:Gem::Dependency
211
- name: timecop
212
208
  prerelease: false
213
- requirement: &id013 !ruby/object:Gem::Requirement
209
+ name: factory_girl
210
+ - !ruby/object:Gem::Dependency
211
+ version_requirements: &id013 !ruby/object:Gem::Requirement
214
212
  none: false
215
213
  requirements:
216
214
  - - ">="
@@ -219,12 +217,12 @@ dependencies:
219
217
  segments:
220
218
  - 0
221
219
  version: "0"
220
+ requirement: *id013
222
221
  type: :development
223
- version_requirements: *id013
224
- - !ruby/object:Gem::Dependency
225
- name: rake
226
222
  prerelease: false
227
- requirement: &id014 !ruby/object:Gem::Requirement
223
+ name: timecop
224
+ - !ruby/object:Gem::Dependency
225
+ version_requirements: &id014 !ruby/object:Gem::Requirement
228
226
  none: false
229
227
  requirements:
230
228
  - - ">="
@@ -233,12 +231,12 @@ dependencies:
233
231
  segments:
234
232
  - 0
235
233
  version: "0"
234
+ requirement: *id014
236
235
  type: :development
237
- version_requirements: *id014
238
- - !ruby/object:Gem::Dependency
239
- name: cucumber
240
236
  prerelease: false
241
- requirement: &id015 !ruby/object:Gem::Requirement
237
+ name: rake
238
+ - !ruby/object:Gem::Dependency
239
+ version_requirements: &id015 !ruby/object:Gem::Requirement
242
240
  none: false
243
241
  requirements:
244
242
  - - ~>
@@ -249,12 +247,12 @@ dependencies:
249
247
  - 0
250
248
  - 6
251
249
  version: 1.0.6
250
+ requirement: *id015
252
251
  type: :development
253
- version_requirements: *id015
254
- - !ruby/object:Gem::Dependency
255
- name: rspec-rails
256
252
  prerelease: false
257
- requirement: &id016 !ruby/object:Gem::Requirement
253
+ name: cucumber
254
+ - !ruby/object:Gem::Dependency
255
+ version_requirements: &id016 !ruby/object:Gem::Requirement
258
256
  none: false
259
257
  requirements:
260
258
  - - ">="
@@ -263,12 +261,12 @@ dependencies:
263
261
  segments:
264
262
  - 0
265
263
  version: "0"
264
+ requirement: *id016
266
265
  type: :development
267
- version_requirements: *id016
268
- - !ruby/object:Gem::Dependency
269
- name: rails
270
266
  prerelease: false
271
- requirement: &id017 !ruby/object:Gem::Requirement
267
+ name: rspec-rails
268
+ - !ruby/object:Gem::Dependency
269
+ version_requirements: &id017 !ruby/object:Gem::Requirement
272
270
  none: false
273
271
  requirements:
274
272
  - - ">="
@@ -279,12 +277,12 @@ dependencies:
279
277
  - 0
280
278
  - 3
281
279
  version: 3.0.3
280
+ requirement: *id017
282
281
  type: :development
283
- version_requirements: *id017
284
- - !ruby/object:Gem::Dependency
285
- name: thin
286
282
  prerelease: false
287
- requirement: &id018 !ruby/object:Gem::Requirement
283
+ name: rails
284
+ - !ruby/object:Gem::Dependency
285
+ version_requirements: &id018 !ruby/object:Gem::Requirement
288
286
  none: false
289
287
  requirements:
290
288
  - - ">="
@@ -293,8 +291,10 @@ dependencies:
293
291
  segments:
294
292
  - 0
295
293
  version: "0"
294
+ requirement: *id018
296
295
  type: :development
297
- version_requirements: *id018
296
+ prerelease: false
297
+ name: thin
298
298
  description: Clearance-based Rails engine for Software as a Service (Saas) that provides account and project management
299
299
  email: support@thoughtbot.com
300
300
  executables: []
@@ -304,7 +304,6 @@ extensions: []
304
304
  extra_rdoc_files: []
305
305
 
306
306
  files:
307
- - .bundle/config
308
307
  - .gitignore
309
308
  - .rspec
310
309
  - CHANGELOG.md
@@ -463,7 +462,7 @@ files:
463
462
  - spec/environment.rb
464
463
  - spec/layouts_spec.rb
465
464
  - spec/mailers/billing_mailer_spec.rb
466
- - spec/mailers/invitiation_mailer_spec.rb
465
+ - spec/mailers/invitation_mailer_spec.rb
467
466
  - spec/models/account_spec.rb
468
467
  - spec/models/canceled_account_spec.rb
469
468
  - spec/models/coupon_spec.rb
@@ -546,7 +545,7 @@ test_files:
546
545
  - spec/environment.rb
547
546
  - spec/layouts_spec.rb
548
547
  - spec/mailers/billing_mailer_spec.rb
549
- - spec/mailers/invitiation_mailer_spec.rb
548
+ - spec/mailers/invitation_mailer_spec.rb
550
549
  - spec/models/account_spec.rb
551
550
  - spec/models/canceled_account_spec.rb
552
551
  - spec/models/coupon_spec.rb
@@ -1,2 +0,0 @@
1
- --- {}
2
-