pillowfort 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/pillowfort/concerns/model_authentication.rb +9 -5
- data/lib/pillowfort.rb +1 -0
- data/lib/pillowfort/config.rb +25 -0
- data/lib/pillowfort/version.rb +1 -1
- data/spec/dummy/db/schema.rb +3 -4
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/test.log +2395 -0
- data/spec/models/account_spec.rb +0 -13
- metadata +3 -6
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/migrate/20150413161345_add_auth_token_ttl_to_account.rb +0 -7
data/spec/models/account_spec.rb
CHANGED
@@ -162,7 +162,6 @@ RSpec.describe Account, :type => :model do
|
|
162
162
|
FactoryGirl.create :account,
|
163
163
|
auth_token: auth_token,
|
164
164
|
auth_token_expires_at: auth_token_expires_at,
|
165
|
-
auth_token_ttl: auth_token_ttl,
|
166
165
|
password_reset_token: password_reset_token,
|
167
166
|
password_reset_token_expires_at: password_reset_token_expires_at,
|
168
167
|
activation_token: activation_token,
|
@@ -171,7 +170,6 @@ RSpec.describe Account, :type => :model do
|
|
171
170
|
|
172
171
|
let(:auth_token) { 'abc123def456' }
|
173
172
|
let(:auth_token_expires_at) { 1.day.from_now }
|
174
|
-
let(:auth_token_ttl) { 1.hour }
|
175
173
|
let(:password_reset_token) { '123abc456def' }
|
176
174
|
let(:password_reset_token_expires_at) { 1.hour.from_now }
|
177
175
|
let(:activation_token) { 'activateme' }
|
@@ -347,7 +345,6 @@ RSpec.describe Account, :type => :model do
|
|
347
345
|
let(:token) { 'deadbeef' }
|
348
346
|
let(:password) { 'admin4lolz' }
|
349
347
|
let(:auth_token_expires_at) { 1.day.from_now }
|
350
|
-
let(:auth_token_ttl) { 1.day }
|
351
348
|
let(:activation_token) { 'activateme' }
|
352
349
|
let(:activation_token_expires_at) { 1.hour.from_now }
|
353
350
|
let(:password_reset_token) { 'resetme' }
|
@@ -359,7 +356,6 @@ RSpec.describe Account, :type => :model do
|
|
359
356
|
auth_token: token,
|
360
357
|
password: password,
|
361
358
|
auth_token_expires_at: auth_token_expires_at,
|
362
|
-
auth_token_ttl: auth_token_ttl,
|
363
359
|
password_reset_token: password_reset_token,
|
364
360
|
password_reset_token_expires_at: password_reset_token_expires_at,
|
365
361
|
activation_token: activation_token,
|
@@ -401,15 +397,6 @@ RSpec.describe Account, :type => :model do
|
|
401
397
|
expect { |b| Account.authenticate_securely(email_param, token_param, &b) }.to yield_with_args(account)
|
402
398
|
end
|
403
399
|
end
|
404
|
-
|
405
|
-
context 'when the resource has a longer auth token ttl date than usual...' do
|
406
|
-
let(:now) { Time.now }
|
407
|
-
let(:auth_token_ttl) { 1.week }
|
408
|
-
before { Account.authenticate_securely(email_param, token_param, &block) }
|
409
|
-
subject { account.reload }
|
410
|
-
|
411
|
-
its(:auth_token_expires_at) { should be_within(2.seconds).of(now + auth_token_ttl)}
|
412
|
-
end
|
413
400
|
end
|
414
401
|
|
415
402
|
context 'when the resource is located' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pillowfort
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tim Lowrimore
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-07-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -124,6 +124,7 @@ files:
|
|
124
124
|
- app/models/pillowfort/concerns/model_password_reset.rb
|
125
125
|
- config/routes.rb
|
126
126
|
- lib/pillowfort.rb
|
127
|
+
- lib/pillowfort/config.rb
|
127
128
|
- lib/pillowfort/controller_methods.rb
|
128
129
|
- lib/pillowfort/engine.rb
|
129
130
|
- lib/pillowfort/model_context.rb
|
@@ -169,11 +170,9 @@ files:
|
|
169
170
|
- spec/dummy/config/locales/en.yml
|
170
171
|
- spec/dummy/config/routes.rb
|
171
172
|
- spec/dummy/config/secrets.yml
|
172
|
-
- spec/dummy/db/development.sqlite3
|
173
173
|
- spec/dummy/db/migrate/20150127045508_create_accounts.rb
|
174
174
|
- spec/dummy/db/migrate/20150210215727_add_password_reset_tokens.rb
|
175
175
|
- spec/dummy/db/migrate/20150211185152_add_activation_token_to_account.rb
|
176
|
-
- spec/dummy/db/migrate/20150413161345_add_auth_token_ttl_to_account.rb
|
177
176
|
- spec/dummy/db/schema.rb
|
178
177
|
- spec/dummy/db/test.sqlite3
|
179
178
|
- spec/dummy/log/test.log
|
@@ -247,11 +246,9 @@ test_files:
|
|
247
246
|
- spec/dummy/config/routes.rb
|
248
247
|
- spec/dummy/config/secrets.yml
|
249
248
|
- spec/dummy/config.ru
|
250
|
-
- spec/dummy/db/development.sqlite3
|
251
249
|
- spec/dummy/db/migrate/20150127045508_create_accounts.rb
|
252
250
|
- spec/dummy/db/migrate/20150210215727_add_password_reset_tokens.rb
|
253
251
|
- spec/dummy/db/migrate/20150211185152_add_activation_token_to_account.rb
|
254
|
-
- spec/dummy/db/migrate/20150413161345_add_auth_token_ttl_to_account.rb
|
255
252
|
- spec/dummy/db/schema.rb
|
256
253
|
- spec/dummy/db/test.sqlite3
|
257
254
|
- spec/dummy/log/test.log
|
Binary file
|