authpro 0.1.0 → 0.9.0
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.
- checksums.yaml +4 -4
- data/README.md +49 -0
- data/lib/authpro/version.rb +2 -2
- data/lib/generators/authpro/authpro_generator.rb +30 -4
- data/lib/generators/authpro/templates/password_resets_controller.rb +2 -1
- data/test/authpro_generator_test.rb +1 -1
- data/test/authpro_integration_test.rb +8 -9
- data/test/rails/dummy/app/controllers/password_resets_controller.rb +2 -1
- data/test/rails/dummy/app/models/user.rb +5 -5
- data/test/rails/dummy/db/migrate/{20130310185934_create_users.rb → 20130315220020_create_users.rb} +0 -0
- data/test/rails/dummy/db/test.sqlite3 +0 -0
- data/test/rails/dummy/log/test.log +281 -267
- data/test/rails/dummy/test/fixtures/users.yml +2 -2
- data/test/test_helper.rb +5 -0
- metadata +19 -5
- data/lib/generators/authpro/templates/user.rb +0 -25
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f8675e043265670c37fd85f974167454e8e6899c
|
4
|
+
data.tar.gz: 51774bc01fb0cd836a5f99b84d3b283de4132066
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 78745d8c4d4a8b9235c1738989b57feb45f834a3d0b8628037a405ef9ad21ee9a6e775a4c49dbfd8f2b0f7c6b5bbeb5d83113f3763165639446fff5602be202b
|
7
|
+
data.tar.gz: daecf5149374062c7970de50b52ffd221ce37492f363871d9bb73639259a4fd02e3dd31e864205e13e37e96f78749a44c86ec1c8479661f1e56e0110d6f5c65f
|
data/README.md
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
# Authpro - Rails 4 only at the moment
|
2
|
+
|
3
|
+
Work in progress but fully functional.
|
4
|
+
|
5
|
+
[](https://codeclimate.com/github/ricn/authpro)
|
6
|
+
[](https://travis-ci.org/ricn/authpro)
|
7
|
+
|
8
|
+
Authpro is a simple authentication generator for Rails. It:
|
9
|
+
|
10
|
+
* Gives you sign up, log in, remember me & password reset funtionality
|
11
|
+
* Has no hidden code, weird sub classes or mixins
|
12
|
+
* Has no configuration
|
13
|
+
|
14
|
+
Authpro assumes you want:
|
15
|
+
|
16
|
+
* User as the model
|
17
|
+
* Email for login
|
18
|
+
* Erb for views. This might be configurable in the future because I like writing views using Slim.
|
19
|
+
|
20
|
+
However, you can easily change the code that Authpro generates if you want to. It's just simple Ruby / Rails code.
|
21
|
+
|
22
|
+
To be honest you really should change the generated code. Most of the code in the user model should be moved to a different place. You can use the new concerns functionality in Rails 4. More information about concerns can be found [here](http://37signals.com/svn/posts/3372-put-chubby-models-on-a-diet-with-concerns).
|
23
|
+
|
24
|
+
If concerns concerns you, you can always extract the code into Service Objects. More info about Service Objects can be found [here](http://railscasts.com/episodes/398-service-objects).
|
25
|
+
|
26
|
+
## Installation
|
27
|
+
|
28
|
+
Add this line to your application's Gemfile:
|
29
|
+
|
30
|
+
gem 'authpro'
|
31
|
+
|
32
|
+
And then execute:
|
33
|
+
|
34
|
+
$ bundle
|
35
|
+
$ rails generate authpro
|
36
|
+
$ rake db:migrate
|
37
|
+
$ rails server
|
38
|
+
|
39
|
+
Open browser:
|
40
|
+
|
41
|
+
$ open http://localhost:3000
|
42
|
+
|
43
|
+
## Contributing
|
44
|
+
|
45
|
+
1. Fork it
|
46
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
47
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
48
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
49
|
+
5. Create new Pull Request
|
data/lib/authpro/version.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
1
|
module Authpro
|
2
|
-
VERSION = "0.
|
3
|
-
end
|
2
|
+
VERSION = "0.9.0"
|
3
|
+
end
|
@@ -5,9 +5,37 @@ class AuthproGenerator < Rails::Generators::Base
|
|
5
5
|
generate(:model, "user email:string password_digest:string auth_token:string password_reset_token:string password_reset_sent_at:datetime --force")
|
6
6
|
end
|
7
7
|
|
8
|
-
def
|
9
|
-
|
8
|
+
def inject_model_code
|
9
|
+
inject_into_file 'app/models/user.rb', :after => "class User < ActiveRecord::Base\n" do
|
10
|
+
|
11
|
+
<<-'RUBY'
|
12
|
+
has_secure_password
|
13
|
+
|
14
|
+
validates :password, presence: true, on: :create
|
15
|
+
validates :email, presence: true, uniqueness: true, format: /@/
|
16
|
+
|
17
|
+
before_create { generate_token(:auth_token) }
|
18
|
+
|
19
|
+
def self.authenticate(email, password)
|
20
|
+
user = find_by email: email
|
21
|
+
user if user && user.authenticate(password)
|
22
|
+
end
|
23
|
+
|
24
|
+
def generate_token(column)
|
25
|
+
begin
|
26
|
+
self[column] = SecureRandom.urlsafe_base64
|
27
|
+
end while User.exists?(column => self[column])
|
28
|
+
end
|
29
|
+
|
30
|
+
def prepare_password_reset
|
31
|
+
generate_token(:password_reset_token)
|
32
|
+
self.password_reset_sent_at = Time.zone.now
|
33
|
+
save!
|
34
|
+
end
|
35
|
+
RUBY
|
36
|
+
|
10
37
|
end
|
38
|
+
end
|
11
39
|
|
12
40
|
def copy_controllers
|
13
41
|
copy_file "users_controller.rb", "app/controllers/users_controller.rb"
|
@@ -54,6 +82,4 @@ class AuthproGenerator < Rails::Generators::Base
|
|
54
82
|
" config.action_mailer.default_url_options = { host: \"localhost:3000\" }\n"
|
55
83
|
end
|
56
84
|
end
|
57
|
-
|
58
|
-
# $ rails g model user email:string password_digest:string auth_token:string password_reset_token:string password_reset_sent_at:datetime
|
59
85
|
end
|
@@ -6,7 +6,8 @@ class PasswordResetsController < ApplicationController
|
|
6
6
|
user = User.find_by email: params[:email]
|
7
7
|
|
8
8
|
if user
|
9
|
-
user.
|
9
|
+
user.prepare_password_reset
|
10
|
+
UserMailer.password_reset(user).deliver
|
10
11
|
redirect_to root_url, notice: "Email sent with password reset instructions."
|
11
12
|
else
|
12
13
|
flash.now.alert = "We could not find anyone with that email address."
|
@@ -4,14 +4,13 @@ require "uri"
|
|
4
4
|
class AuthproIntegrationTest < ActionDispatch::IntegrationTest
|
5
5
|
|
6
6
|
setup do
|
7
|
-
# We should really run the generator here
|
8
7
|
ActiveRecord::Migration.verbose = false
|
9
8
|
ActiveRecord::Migrator.migrate("#{Rails.root}/db/migrate")
|
10
9
|
Dummy::Application.reload_routes!
|
11
|
-
@user = User.create!(email:
|
10
|
+
@user = User.create!(email: fake_email, password: "sekret123", password_confirmation: "sekret123")
|
12
11
|
end
|
13
12
|
|
14
|
-
test "
|
13
|
+
test "visit home" do
|
15
14
|
visit "/"
|
16
15
|
assert page.body.include? "Home"
|
17
16
|
end
|
@@ -19,7 +18,7 @@ class AuthproIntegrationTest < ActionDispatch::IntegrationTest
|
|
19
18
|
test "signup" do
|
20
19
|
visit "/"
|
21
20
|
click_link "Sign up"
|
22
|
-
fill_in "Email", with:
|
21
|
+
fill_in "Email", with: fake_email
|
23
22
|
pass = "sekret123"
|
24
23
|
fill_in "user_password", with: pass
|
25
24
|
fill_in "user_password_confirmation", with: pass
|
@@ -30,7 +29,7 @@ class AuthproIntegrationTest < ActionDispatch::IntegrationTest
|
|
30
29
|
test "signup failing" do
|
31
30
|
visit "/"
|
32
31
|
click_link "Sign up"
|
33
|
-
fill_in "Email", with:
|
32
|
+
fill_in "Email", with: fake_email
|
34
33
|
fill_in "user_password", with: "sekret123"
|
35
34
|
fill_in "user_password_confirmation", with: "another password"
|
36
35
|
click_button "Sign up"
|
@@ -64,7 +63,7 @@ class AuthproIntegrationTest < ActionDispatch::IntegrationTest
|
|
64
63
|
assert page.body.include?("Logged out!")
|
65
64
|
end
|
66
65
|
|
67
|
-
test "
|
66
|
+
test "reset password" do
|
68
67
|
visit "/login"
|
69
68
|
click_link "Forgot your password?"
|
70
69
|
fill_in "Email", with: @user.email
|
@@ -86,7 +85,7 @@ class AuthproIntegrationTest < ActionDispatch::IntegrationTest
|
|
86
85
|
assert page.body.include?("Password has been reset.")
|
87
86
|
end
|
88
87
|
|
89
|
-
test "
|
88
|
+
test "reset password failing because email does not exist" do
|
90
89
|
visit "/login"
|
91
90
|
click_link "Forgot your password?"
|
92
91
|
fill_in "Email", with: "nosense@example.com"
|
@@ -94,7 +93,7 @@ class AuthproIntegrationTest < ActionDispatch::IntegrationTest
|
|
94
93
|
assert page.body.include?("We could not find anyone with that email address.")
|
95
94
|
end
|
96
95
|
|
97
|
-
test "
|
96
|
+
test "reset password failing because we enter a new invalid password" do
|
98
97
|
visit "/login"
|
99
98
|
click_link "Forgot your password?"
|
100
99
|
fill_in "Email", with: @user.email
|
@@ -116,7 +115,7 @@ class AuthproIntegrationTest < ActionDispatch::IntegrationTest
|
|
116
115
|
assert page.body.include?("Form is invalid")
|
117
116
|
end
|
118
117
|
|
119
|
-
test "
|
118
|
+
test "reset password failing because of expiration" do
|
120
119
|
visit "/login"
|
121
120
|
click_link "Forgot your password?"
|
122
121
|
fill_in "Email", with: @user.email
|
@@ -6,7 +6,8 @@ class PasswordResetsController < ApplicationController
|
|
6
6
|
user = User.find_by email: params[:email]
|
7
7
|
|
8
8
|
if user
|
9
|
-
user.
|
9
|
+
user.prepare_password_reset
|
10
|
+
UserMailer.password_reset(user).deliver
|
10
11
|
redirect_to root_url, notice: "Email sent with password reset instructions."
|
11
12
|
else
|
12
13
|
flash.now.alert = "We could not find anyone with that email address."
|
@@ -1,8 +1,9 @@
|
|
1
1
|
class User < ActiveRecord::Base
|
2
2
|
has_secure_password
|
3
3
|
|
4
|
-
|
5
|
-
|
4
|
+
validates :password, presence: true, on: :create
|
5
|
+
validates :email, presence: true, uniqueness: true, format: /@/
|
6
|
+
|
6
7
|
before_create { generate_token(:auth_token) }
|
7
8
|
|
8
9
|
def self.authenticate(email, password)
|
@@ -16,10 +17,9 @@ class User < ActiveRecord::Base
|
|
16
17
|
end while User.exists?(column => self[column])
|
17
18
|
end
|
18
19
|
|
19
|
-
def
|
20
|
+
def prepare_password_reset
|
20
21
|
generate_token(:password_reset_token)
|
21
22
|
self.password_reset_sent_at = Time.zone.now
|
22
23
|
save!
|
23
|
-
UserMailer.password_reset(self).deliver
|
24
24
|
end
|
25
|
-
end
|
25
|
+
end
|
data/test/rails/dummy/db/migrate/{20130310185934_create_users.rb → 20130315220020_create_users.rb}
RENAMED
File without changes
|
Binary file
|
@@ -70,50 +70,138 @@ AuthproGeneratorTest: test_Assert_all_files_are_properly_created
|
|
70
70
|
----------------------------------------------------------------
|
71
71
|
[1m[36m (0.3ms)[0m [1mbegin transaction[0m
|
72
72
|
[1m[35m (0.1ms)[0m rollback transaction
|
73
|
-
|
74
|
-
AuthproGeneratorTest:
|
75
|
-
|
76
|
-
[1m[36m (0.
|
77
|
-
[1m[35m (0.
|
78
|
-
|
79
|
-
AuthproIntegrationTest:
|
80
|
-
|
81
|
-
[1m[36m (
|
82
|
-
[1m[35m (0.
|
73
|
+
------------------------------------------
|
74
|
+
AuthproGeneratorTest: test_generated_files
|
75
|
+
------------------------------------------
|
76
|
+
[1m[36m (0.3ms)[0m [1mbegin transaction[0m
|
77
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
78
|
+
----------------------------------
|
79
|
+
AuthproIntegrationTest: test_login
|
80
|
+
----------------------------------
|
81
|
+
[1m[36m (1.0ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) [0m
|
82
|
+
[1m[35m (0.8ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
83
83
|
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
84
|
-
Migrating to CreateUsers (
|
84
|
+
Migrating to CreateUsers (20130315220020)
|
85
85
|
[1m[35m (0.1ms)[0m begin transaction
|
86
|
-
[1m[36m (0.
|
87
|
-
[1m[35mSQL (0.
|
86
|
+
[1m[36m (0.5ms)[0m [1mCREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar(255), "password_digest" varchar(255), "auth_token" varchar(255), "password_reset_token" varchar(255), "password_reset_sent_at" datetime, "created_at" datetime, "updated_at" datetime) [0m
|
87
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20130315220020"]]
|
88
88
|
[1m[36m (0.7ms)[0m [1mcommit transaction[0m
|
89
89
|
[1m[35m (0.1ms)[0m begin transaction
|
90
|
-
[1m[36mUser Exists (0.2ms)[0m [1mSELECT 1 AS one FROM "users" WHERE "users"."
|
90
|
+
[1m[36mUser Exists (0.2ms)[0m [1mSELECT 1 AS one FROM "users" WHERE "users"."email" = 'kCP6EiM-UskBB7XszXO5ZQ@sample.com' LIMIT 1[0m
|
91
|
+
[1m[35mUser Exists (0.1ms)[0m SELECT 1 AS one FROM "users" WHERE "users"."auth_token" = 'VmWUxHDzhHJhIqBnmqxu-Q' LIMIT 1
|
92
|
+
Binary data inserted for `string` type on column `password_digest`
|
93
|
+
[1m[36mSQL (39.9ms)[0m [1mINSERT INTO "users" ("auth_token", "created_at", "email", "password_digest", "updated_at") VALUES (?, ?, ?, ?, ?)[0m [["auth_token", "VmWUxHDzhHJhIqBnmqxu-Q"], ["created_at", Fri, 15 Mar 2013 22:00:20 UTC +00:00], ["email", "kCP6EiM-UskBB7XszXO5ZQ@sample.com"], ["password_digest", "$2a$04$QZOsJ7gK6Ms6/QYik8g6xOV5Fsp6gUTkYaWeNDGTLkParxZHkdiEO"], ["updated_at", Fri, 15 Mar 2013 22:00:20 UTC +00:00]]
|
94
|
+
[1m[35m (0.6ms)[0m commit transaction
|
95
|
+
Started GET "/" for 127.0.0.1 at 2013-03-15 23:00:21 +0100
|
96
|
+
Processing by HomeController#index as HTML
|
97
|
+
Rendered home/index.html.erb within layouts/application (1.7ms)
|
98
|
+
Completed 200 OK in 31ms (Views: 30.2ms | ActiveRecord: 0.0ms)
|
99
|
+
Started GET "/login" for 127.0.0.1 at 2013-03-15 23:00:21 +0100
|
100
|
+
Processing by SessionsController#new as HTML
|
101
|
+
Rendered sessions/new.html.erb within layouts/application (1.6ms)
|
102
|
+
Completed 200 OK in 4ms (Views: 4.1ms | ActiveRecord: 0.0ms)
|
103
|
+
Started POST "/sessions" for 127.0.0.1 at 2013-03-15 23:00:21 +0100
|
104
|
+
Processing by SessionsController#create as HTML
|
105
|
+
Parameters: {"utf8"=>"✓", "email"=>"kCP6EiM-UskBB7XszXO5ZQ@sample.com", "password"=>"[FILTERED]", "commit"=>"Log in"}
|
106
|
+
[1m[36mUser Load (0.2ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."email" = 'kCP6EiM-UskBB7XszXO5ZQ@sample.com' LIMIT 1[0m
|
107
|
+
Redirected to http://www.example.com/
|
108
|
+
Completed 302 Found in 4ms (ActiveRecord: 0.2ms)
|
109
|
+
Started GET "/" for 127.0.0.1 at 2013-03-15 23:00:21 +0100
|
110
|
+
Processing by HomeController#index as HTML
|
111
|
+
Rendered home/index.html.erb within layouts/application (0.1ms)
|
112
|
+
[1m[35mUser Load (0.2ms)[0m SELECT "users".* FROM "users" WHERE "users"."auth_token" = 'VmWUxHDzhHJhIqBnmqxu-Q' LIMIT 1
|
113
|
+
Completed 200 OK in 3ms (Views: 3.0ms | ActiveRecord: 0.2ms)
|
114
|
+
[1m[36m (0.8ms)[0m [1mDELETE FROM "users";[0m
|
115
|
+
[1m[35m (0.1ms)[0m SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
|
116
|
+
[1m[36m (0.6ms)[0m [1mDELETE FROM sqlite_sequence where name = 'users';[0m
|
117
|
+
------------------------------------------
|
118
|
+
AuthproIntegrationTest: test_login_failing
|
119
|
+
------------------------------------------
|
120
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
121
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
122
|
+
[1m[35mUser Exists (0.1ms)[0m SELECT 1 AS one FROM "users" WHERE "users"."email" = 'j7DiMyVZSNx-2BxkssD4uA@sample.com' LIMIT 1
|
123
|
+
[1m[36mUser Exists (0.1ms)[0m [1mSELECT 1 AS one FROM "users" WHERE "users"."auth_token" = 'dndOqfUeGBRdwu37LeW2dQ' LIMIT 1[0m
|
124
|
+
Binary data inserted for `string` type on column `password_digest`
|
125
|
+
[1m[35mSQL (0.4ms)[0m INSERT INTO "users" ("auth_token", "created_at", "email", "password_digest", "updated_at") VALUES (?, ?, ?, ?, ?) [["auth_token", "dndOqfUeGBRdwu37LeW2dQ"], ["created_at", Fri, 15 Mar 2013 22:00:21 UTC +00:00], ["email", "j7DiMyVZSNx-2BxkssD4uA@sample.com"], ["password_digest", "$2a$04$EYbWtfTAOHfQClY9B46KpO4Ac02oIxdSOjOWIsGfTo6OW8ugEdbaS"], ["updated_at", Fri, 15 Mar 2013 22:00:21 UTC +00:00]]
|
126
|
+
[1m[36m (8.7ms)[0m [1mcommit transaction[0m
|
127
|
+
Started GET "/" for 127.0.0.1 at 2013-03-15 23:00:21 +0100
|
128
|
+
Processing by HomeController#index as HTML
|
129
|
+
Completed 200 OK in 2ms (Views: 1.3ms | ActiveRecord: 0.0ms)
|
130
|
+
Started GET "/login" for 127.0.0.1 at 2013-03-15 23:00:21 +0100
|
131
|
+
Processing by SessionsController#new as HTML
|
132
|
+
Completed 200 OK in 2ms (Views: 1.9ms | ActiveRecord: 0.0ms)
|
133
|
+
Started POST "/sessions" for 127.0.0.1 at 2013-03-15 23:00:21 +0100
|
134
|
+
Processing by SessionsController#create as HTML
|
135
|
+
Parameters: {"utf8"=>"✓", "email"=>"j7DiMyVZSNx-2BxkssD4uA@sample.com", "password"=>"[FILTERED]", "commit"=>"Log in"}
|
136
|
+
[1m[35mUser Load (0.2ms)[0m SELECT "users".* FROM "users" WHERE "users"."email" = 'j7DiMyVZSNx-2BxkssD4uA@sample.com' LIMIT 1
|
137
|
+
Completed 200 OK in 4ms (Views: 1.7ms | ActiveRecord: 0.2ms)
|
138
|
+
[1m[36m (0.9ms)[0m [1mDELETE FROM "users";[0m
|
139
|
+
[1m[35m (0.2ms)[0m SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
|
140
|
+
[1m[36m (14.1ms)[0m [1mDELETE FROM sqlite_sequence where name = 'users';[0m
|
141
|
+
-----------------------------------
|
142
|
+
AuthproIntegrationTest: test_logout
|
143
|
+
-----------------------------------
|
144
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
145
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
146
|
+
[1m[35mUser Exists (0.1ms)[0m SELECT 1 AS one FROM "users" WHERE "users"."email" = 'nvry-P5gvxLsCYenTfZoAg@sample.com' LIMIT 1
|
147
|
+
[1m[36mUser Exists (0.1ms)[0m [1mSELECT 1 AS one FROM "users" WHERE "users"."auth_token" = 'mXuKbMvevPDuz-RI3rn9yw' LIMIT 1[0m
|
148
|
+
Binary data inserted for `string` type on column `password_digest`
|
149
|
+
[1m[35mSQL (0.4ms)[0m INSERT INTO "users" ("auth_token", "created_at", "email", "password_digest", "updated_at") VALUES (?, ?, ?, ?, ?) [["auth_token", "mXuKbMvevPDuz-RI3rn9yw"], ["created_at", Fri, 15 Mar 2013 22:00:21 UTC +00:00], ["email", "nvry-P5gvxLsCYenTfZoAg@sample.com"], ["password_digest", "$2a$04$LWsqUfJUVdWNGUYosMdBBOCVQ4hNNkPbpGMy4U7i5LErbwvfxayzG"], ["updated_at", Fri, 15 Mar 2013 22:00:21 UTC +00:00]]
|
150
|
+
[1m[36m (0.6ms)[0m [1mcommit transaction[0m
|
151
|
+
Started GET "/login" for 127.0.0.1 at 2013-03-15 23:00:21 +0100
|
152
|
+
Processing by SessionsController#new as HTML
|
153
|
+
Completed 200 OK in 2ms (Views: 1.5ms | ActiveRecord: 0.0ms)
|
154
|
+
Started POST "/sessions" for 127.0.0.1 at 2013-03-15 23:00:21 +0100
|
155
|
+
Processing by SessionsController#create as HTML
|
156
|
+
Parameters: {"utf8"=>"✓", "email"=>"nvry-P5gvxLsCYenTfZoAg@sample.com", "password"=>"[FILTERED]", "commit"=>"Log in"}
|
157
|
+
[1m[35mUser Load (0.2ms)[0m SELECT "users".* FROM "users" WHERE "users"."email" = 'nvry-P5gvxLsCYenTfZoAg@sample.com' LIMIT 1
|
158
|
+
Redirected to http://www.example.com/
|
159
|
+
Completed 302 Found in 3ms (ActiveRecord: 0.2ms)
|
160
|
+
Started GET "/" for 127.0.0.1 at 2013-03-15 23:00:21 +0100
|
161
|
+
Processing by HomeController#index as HTML
|
162
|
+
[1m[36mUser Load (0.2ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."auth_token" = 'mXuKbMvevPDuz-RI3rn9yw' LIMIT 1[0m
|
163
|
+
Completed 200 OK in 2ms (Views: 2.0ms | ActiveRecord: 0.2ms)
|
164
|
+
Started GET "/logout" for 127.0.0.1 at 2013-03-15 23:00:21 +0100
|
165
|
+
Processing by SessionsController#destroy as HTML
|
166
|
+
Redirected to http://www.example.com/
|
167
|
+
Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
|
168
|
+
Started GET "/" for 127.0.0.1 at 2013-03-15 23:00:21 +0100
|
169
|
+
Processing by HomeController#index as HTML
|
170
|
+
Completed 200 OK in 2ms (Views: 1.4ms | ActiveRecord: 0.0ms)
|
171
|
+
[1m[35m (0.9ms)[0m DELETE FROM "users";
|
172
|
+
[1m[36m (0.2ms)[0m [1mSELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';[0m
|
173
|
+
[1m[35m (0.7ms)[0m DELETE FROM sqlite_sequence where name = 'users';
|
174
|
+
-------------------------------------------
|
175
|
+
AuthproIntegrationTest: test_reset_password
|
176
|
+
-------------------------------------------
|
177
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
178
|
+
[1m[35m (0.1ms)[0m begin transaction
|
179
|
+
[1m[36mUser Exists (0.1ms)[0m [1mSELECT 1 AS one FROM "users" WHERE "users"."email" = 'xcfHKYjkhbBENzvZApGSvA@sample.com' LIMIT 1[0m
|
180
|
+
[1m[35mUser Exists (0.1ms)[0m SELECT 1 AS one FROM "users" WHERE "users"."auth_token" = 'oDRqFosEUVoGSKIQl-xAnw' LIMIT 1
|
91
181
|
Binary data inserted for `string` type on column `password_digest`
|
92
|
-
[1m[
|
93
|
-
[1m[
|
94
|
-
Started GET "/login" for 127.0.0.1 at 2013-03-
|
182
|
+
[1m[36mSQL (0.4ms)[0m [1mINSERT INTO "users" ("auth_token", "created_at", "email", "password_digest", "updated_at") VALUES (?, ?, ?, ?, ?)[0m [["auth_token", "oDRqFosEUVoGSKIQl-xAnw"], ["created_at", Fri, 15 Mar 2013 22:00:21 UTC +00:00], ["email", "xcfHKYjkhbBENzvZApGSvA@sample.com"], ["password_digest", "$2a$04$jlyuM0GWRt7rcoj/7mmaWeyDg4O1h0A.c0/O/JHJeikauzKR1Sv7q"], ["updated_at", Fri, 15 Mar 2013 22:00:21 UTC +00:00]]
|
183
|
+
[1m[35m (7.3ms)[0m commit transaction
|
184
|
+
Started GET "/login" for 127.0.0.1 at 2013-03-15 23:00:21 +0100
|
95
185
|
Processing by SessionsController#new as HTML
|
96
|
-
|
97
|
-
|
98
|
-
Started GET "/password_resets/new" for 127.0.0.1 at 2013-03-10 19:59:35 +0100
|
186
|
+
Completed 200 OK in 2ms (Views: 1.5ms | ActiveRecord: 0.0ms)
|
187
|
+
Started GET "/password_resets/new" for 127.0.0.1 at 2013-03-15 23:00:21 +0100
|
99
188
|
Processing by PasswordResetsController#new as HTML
|
100
|
-
|
101
|
-
|
102
|
-
Started POST "/password_resets" for 127.0.0.1 at 2013-03-10 19:59:35 +0100
|
189
|
+
Completed 200 OK in 4ms (Views: 3.7ms | ActiveRecord: 0.0ms)
|
190
|
+
Started POST "/password_resets" for 127.0.0.1 at 2013-03-15 23:00:21 +0100
|
103
191
|
Processing by PasswordResetsController#create as HTML
|
104
|
-
Parameters: {"utf8"=>"✓", "email"=>"
|
105
|
-
[1m[
|
106
|
-
[1m[
|
107
|
-
[1m[
|
108
|
-
[1m[
|
109
|
-
[1m[
|
110
|
-
|
192
|
+
Parameters: {"utf8"=>"✓", "email"=>"xcfHKYjkhbBENzvZApGSvA@sample.com", "commit"=>"Reset password"}
|
193
|
+
[1m[36mUser Load (0.2ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."email" = 'xcfHKYjkhbBENzvZApGSvA@sample.com' LIMIT 1[0m
|
194
|
+
[1m[35mUser Exists (0.1ms)[0m SELECT 1 AS one FROM "users" WHERE "users"."password_reset_token" = '26eCLpCa6kZIYuce2MJBsQ' LIMIT 1
|
195
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
196
|
+
[1m[35mUser Exists (0.1ms)[0m SELECT 1 AS one FROM "users" WHERE ("users"."email" = 'xcfHKYjkhbBENzvZApGSvA@sample.com' AND "users"."id" != 1) LIMIT 1
|
197
|
+
[1m[36mSQL (0.5ms)[0m [1mUPDATE "users" SET "password_reset_token" = ?, "password_reset_sent_at" = ?, "updated_at" = ? WHERE "users"."id" = 1[0m [["password_reset_token", "26eCLpCa6kZIYuce2MJBsQ"], ["password_reset_sent_at", Fri, 15 Mar 2013 22:00:21 UTC +00:00], ["updated_at", Fri, 15 Mar 2013 22:00:21 UTC +00:00]]
|
198
|
+
[1m[35m (0.7ms)[0m commit transaction
|
111
199
|
|
112
|
-
Sent mail to
|
113
|
-
Date:
|
200
|
+
Sent mail to xcfHKYjkhbBENzvZApGSvA@sample.com (7.3ms)
|
201
|
+
Date: Fri, 15 Mar 2013 23:00:21 +0100
|
114
202
|
From: from@example.com
|
115
|
-
To:
|
116
|
-
Message-ID: <
|
203
|
+
To: xcfHKYjkhbBENzvZApGSvA@sample.com
|
204
|
+
Message-ID: <514399f59b423_44c53fed3546067434756@Richards-MacBook-Air.local.mail>
|
117
205
|
Subject: Password Reset
|
118
206
|
Mime-Version: 1.0
|
119
207
|
Content-Type: text/plain;
|
@@ -122,90 +210,91 @@ Content-Transfer-Encoding: 7bit
|
|
122
210
|
|
123
211
|
To reset your password, click the URL below.
|
124
212
|
|
125
|
-
http://localhost:3000/password_resets/
|
213
|
+
http://localhost:3000/password_resets/26eCLpCa6kZIYuce2MJBsQ/edit
|
126
214
|
|
127
215
|
If you did not request your password to be reset, just ignore this email and your password will continue to stay the same.
|
128
216
|
Redirected to http://www.example.com/
|
129
|
-
Completed 302 Found in
|
130
|
-
Started GET "/" for 127.0.0.1 at 2013-03-
|
217
|
+
Completed 302 Found in 309ms (ActiveRecord: 1.6ms)
|
218
|
+
Started GET "/" for 127.0.0.1 at 2013-03-15 23:00:21 +0100
|
131
219
|
Processing by HomeController#index as HTML
|
132
|
-
|
133
|
-
|
134
|
-
Started GET "/password_resets/rwUNZ8Paq8QfXScL2ywhDQ/edit" for 127.0.0.1 at 2013-03-10 19:59:35 +0100
|
220
|
+
Completed 200 OK in 1ms (Views: 1.0ms | ActiveRecord: 0.0ms)
|
221
|
+
Started GET "/password_resets/26eCLpCa6kZIYuce2MJBsQ/edit" for 127.0.0.1 at 2013-03-15 23:00:21 +0100
|
135
222
|
Processing by PasswordResetsController#edit as HTML
|
136
|
-
Parameters: {"id"=>"
|
137
|
-
[1m[36mUser Load (0.2ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."password_reset_token" = '
|
138
|
-
|
139
|
-
|
140
|
-
Started PATCH "/password_resets/rwUNZ8Paq8QfXScL2ywhDQ" for 127.0.0.1 at 2013-03-10 19:59:35 +0100
|
223
|
+
Parameters: {"id"=>"26eCLpCa6kZIYuce2MJBsQ"}
|
224
|
+
[1m[36mUser Load (0.2ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."password_reset_token" = '26eCLpCa6kZIYuce2MJBsQ' LIMIT 1[0m
|
225
|
+
Completed 200 OK in 15ms (Views: 14.0ms | ActiveRecord: 0.2ms)
|
226
|
+
Started PATCH "/password_resets/26eCLpCa6kZIYuce2MJBsQ" for 127.0.0.1 at 2013-03-15 23:00:21 +0100
|
141
227
|
Processing by PasswordResetsController#update as HTML
|
142
|
-
Parameters: {"utf8"=>"✓", "user"=>{"password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]"}, "commit"=>"Change password", "id"=>"
|
143
|
-
[1m[35mUser Load (0.2ms)[0m SELECT "users".* FROM "users" WHERE "users"."password_reset_token" = '
|
228
|
+
Parameters: {"utf8"=>"✓", "user"=>{"password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]"}, "commit"=>"Change password", "id"=>"26eCLpCa6kZIYuce2MJBsQ"}
|
229
|
+
[1m[35mUser Load (0.2ms)[0m SELECT "users".* FROM "users" WHERE "users"."password_reset_token" = '26eCLpCa6kZIYuce2MJBsQ' LIMIT 1
|
144
230
|
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
231
|
+
[1m[35mUser Exists (0.1ms)[0m SELECT 1 AS one FROM "users" WHERE ("users"."email" = 'xcfHKYjkhbBENzvZApGSvA@sample.com' AND "users"."id" != 1) LIMIT 1
|
145
232
|
Binary data inserted for `string` type on column `password_digest`
|
146
|
-
[1m[
|
147
|
-
[1m[
|
233
|
+
[1m[36mSQL (0.4ms)[0m [1mUPDATE "users" SET "password_digest" = ?, "updated_at" = ? WHERE "users"."id" = 1[0m [["password_digest", "$2a$04$p7/SUTUZcezfE2tbdaPJienaL9yUf426EsZ30rs1AI4/QFHOY4rPq"], ["updated_at", Fri, 15 Mar 2013 22:00:21 UTC +00:00]]
|
234
|
+
[1m[35m (0.6ms)[0m commit transaction
|
148
235
|
Redirected to http://localhost:3000/
|
149
|
-
Completed 302 Found in 7ms (ActiveRecord:
|
150
|
-
Started GET "/" for 127.0.0.1 at 2013-03-
|
236
|
+
Completed 302 Found in 7ms (ActiveRecord: 1.5ms)
|
237
|
+
Started GET "/" for 127.0.0.1 at 2013-03-15 23:00:21 +0100
|
151
238
|
Processing by HomeController#index as HTML
|
152
|
-
|
153
|
-
|
154
|
-
[1m[35m (0.
|
155
|
-
[1m[36m (0.
|
156
|
-
[1m[35m (0.7ms)[0m DELETE FROM sqlite_sequence where name = 'users';
|
239
|
+
Completed 200 OK in 2ms (Views: 1.6ms | ActiveRecord: 0.0ms)
|
240
|
+
[1m[36m (0.9ms)[0m [1mDELETE FROM "users";[0m
|
241
|
+
[1m[35m (0.1ms)[0m SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
|
242
|
+
[1m[36m (0.7ms)[0m [1mDELETE FROM sqlite_sequence where name = 'users';[0m
|
157
243
|
--------------------------------------------------------------------------------
|
158
|
-
AuthproIntegrationTest:
|
244
|
+
AuthproIntegrationTest: test_reset_password_failing_because_email_does_not_exist
|
159
245
|
--------------------------------------------------------------------------------
|
160
|
-
[1m[
|
161
|
-
[1m[
|
162
|
-
[1m[
|
246
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
247
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
248
|
+
[1m[35mUser Exists (0.1ms)[0m SELECT 1 AS one FROM "users" WHERE "users"."email" = 'MHnlXv3IQolWCjJwCHUmmQ@sample.com' LIMIT 1
|
249
|
+
[1m[36mUser Exists (0.1ms)[0m [1mSELECT 1 AS one FROM "users" WHERE "users"."auth_token" = 'JRlpzQu09zhBYyR0kfF1dg' LIMIT 1[0m
|
163
250
|
Binary data inserted for `string` type on column `password_digest`
|
164
|
-
[1m[35mSQL (0.
|
165
|
-
[1m[36m (0.
|
166
|
-
Started GET "/login" for 127.0.0.1 at 2013-03-
|
251
|
+
[1m[35mSQL (0.4ms)[0m INSERT INTO "users" ("auth_token", "created_at", "email", "password_digest", "updated_at") VALUES (?, ?, ?, ?, ?) [["auth_token", "JRlpzQu09zhBYyR0kfF1dg"], ["created_at", Fri, 15 Mar 2013 22:00:21 UTC +00:00], ["email", "MHnlXv3IQolWCjJwCHUmmQ@sample.com"], ["password_digest", "$2a$04$GOl6Mvboz5u5zsPqOX1Gt.wLQPHNdJy5nGZjjOUS7HodNUATDGevK"], ["updated_at", Fri, 15 Mar 2013 22:00:21 UTC +00:00]]
|
252
|
+
[1m[36m (0.6ms)[0m [1mcommit transaction[0m
|
253
|
+
Started GET "/login" for 127.0.0.1 at 2013-03-15 23:00:21 +0100
|
167
254
|
Processing by SessionsController#new as HTML
|
168
|
-
Completed 200 OK in 2ms (Views: 1.
|
169
|
-
Started GET "/password_resets/new" for 127.0.0.1 at 2013-03-
|
255
|
+
Completed 200 OK in 2ms (Views: 1.4ms | ActiveRecord: 0.0ms)
|
256
|
+
Started GET "/password_resets/new" for 127.0.0.1 at 2013-03-15 23:00:21 +0100
|
170
257
|
Processing by PasswordResetsController#new as HTML
|
171
|
-
Completed 200 OK in 1ms (Views: 1.
|
172
|
-
Started POST "/password_resets" for 127.0.0.1 at 2013-03-
|
258
|
+
Completed 200 OK in 1ms (Views: 1.0ms | ActiveRecord: 0.0ms)
|
259
|
+
Started POST "/password_resets" for 127.0.0.1 at 2013-03-15 23:00:21 +0100
|
173
260
|
Processing by PasswordResetsController#create as HTML
|
174
261
|
Parameters: {"utf8"=>"✓", "email"=>"nosense@example.com", "commit"=>"Reset password"}
|
175
262
|
[1m[35mUser Load (0.2ms)[0m SELECT "users".* FROM "users" WHERE "users"."email" = 'nosense@example.com' LIMIT 1
|
176
|
-
Completed 200 OK in
|
177
|
-
[1m[36m (
|
178
|
-
[1m[35m (0.
|
179
|
-
[1m[36m (0.
|
263
|
+
Completed 200 OK in 3ms (Views: 1.4ms | ActiveRecord: 0.2ms)
|
264
|
+
[1m[36m (0.8ms)[0m [1mDELETE FROM "users";[0m
|
265
|
+
[1m[35m (0.1ms)[0m SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
|
266
|
+
[1m[36m (0.5ms)[0m [1mDELETE FROM sqlite_sequence where name = 'users';[0m
|
180
267
|
-------------------------------------------------------------------------
|
181
|
-
AuthproIntegrationTest:
|
268
|
+
AuthproIntegrationTest: test_reset_password_failing_because_of_expiration
|
182
269
|
-------------------------------------------------------------------------
|
183
270
|
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
184
271
|
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
185
|
-
[1m[35mUser Exists (0.2ms)[0m SELECT 1 AS one FROM "users" WHERE "users"."
|
272
|
+
[1m[35mUser Exists (0.2ms)[0m SELECT 1 AS one FROM "users" WHERE "users"."email" = 'teoZEEGzyVBVIj2vgFqIMQ@sample.com' LIMIT 1
|
273
|
+
[1m[36mUser Exists (0.1ms)[0m [1mSELECT 1 AS one FROM "users" WHERE "users"."auth_token" = '3iD_C38FXAZJxtd08aXrGQ' LIMIT 1[0m
|
186
274
|
Binary data inserted for `string` type on column `password_digest`
|
187
|
-
[1m[
|
188
|
-
[1m[
|
189
|
-
Started GET "/login" for 127.0.0.1 at 2013-03-
|
275
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "users" ("auth_token", "created_at", "email", "password_digest", "updated_at") VALUES (?, ?, ?, ?, ?) [["auth_token", "3iD_C38FXAZJxtd08aXrGQ"], ["created_at", Fri, 15 Mar 2013 22:00:21 UTC +00:00], ["email", "teoZEEGzyVBVIj2vgFqIMQ@sample.com"], ["password_digest", "$2a$04$rc.NhebfZSqAzRQ2AquEVOAOjBs5OxUfKjGMVU1U8s1wYlW/u7Kfq"], ["updated_at", Fri, 15 Mar 2013 22:00:21 UTC +00:00]]
|
276
|
+
[1m[36m (0.6ms)[0m [1mcommit transaction[0m
|
277
|
+
Started GET "/login" for 127.0.0.1 at 2013-03-15 23:00:21 +0100
|
190
278
|
Processing by SessionsController#new as HTML
|
191
|
-
Completed 200 OK in
|
192
|
-
Started GET "/password_resets/new" for 127.0.0.1 at 2013-03-
|
279
|
+
Completed 200 OK in 2ms (Views: 2.0ms | ActiveRecord: 0.0ms)
|
280
|
+
Started GET "/password_resets/new" for 127.0.0.1 at 2013-03-15 23:00:21 +0100
|
193
281
|
Processing by PasswordResetsController#new as HTML
|
194
|
-
Completed 200 OK in 2ms (Views: 1.
|
195
|
-
Started POST "/password_resets" for 127.0.0.1 at 2013-03-
|
282
|
+
Completed 200 OK in 2ms (Views: 1.7ms | ActiveRecord: 0.0ms)
|
283
|
+
Started POST "/password_resets" for 127.0.0.1 at 2013-03-15 23:00:21 +0100
|
196
284
|
Processing by PasswordResetsController#create as HTML
|
197
|
-
Parameters: {"utf8"=>"✓", "email"=>"
|
198
|
-
[1m[
|
199
|
-
[1m[
|
200
|
-
[1m[
|
201
|
-
[1m[
|
202
|
-
[1m[
|
285
|
+
Parameters: {"utf8"=>"✓", "email"=>"teoZEEGzyVBVIj2vgFqIMQ@sample.com", "commit"=>"Reset password"}
|
286
|
+
[1m[35mUser Load (0.2ms)[0m SELECT "users".* FROM "users" WHERE "users"."email" = 'teoZEEGzyVBVIj2vgFqIMQ@sample.com' LIMIT 1
|
287
|
+
[1m[36mUser Exists (0.1ms)[0m [1mSELECT 1 AS one FROM "users" WHERE "users"."password_reset_token" = 'th8vz_BBAYn0r3440P4tMQ' LIMIT 1[0m
|
288
|
+
[1m[35m (0.1ms)[0m begin transaction
|
289
|
+
[1m[36mUser Exists (0.1ms)[0m [1mSELECT 1 AS one FROM "users" WHERE ("users"."email" = 'teoZEEGzyVBVIj2vgFqIMQ@sample.com' AND "users"."id" != 1) LIMIT 1[0m
|
290
|
+
[1m[35mSQL (0.3ms)[0m UPDATE "users" SET "password_reset_token" = ?, "password_reset_sent_at" = ?, "updated_at" = ? WHERE "users"."id" = 1 [["password_reset_token", "th8vz_BBAYn0r3440P4tMQ"], ["password_reset_sent_at", Fri, 15 Mar 2013 22:00:21 UTC +00:00], ["updated_at", Fri, 15 Mar 2013 22:00:21 UTC +00:00]]
|
291
|
+
[1m[36m (0.6ms)[0m [1mcommit transaction[0m
|
203
292
|
|
204
|
-
Sent mail to
|
205
|
-
Date:
|
293
|
+
Sent mail to teoZEEGzyVBVIj2vgFqIMQ@sample.com (7.0ms)
|
294
|
+
Date: Fri, 15 Mar 2013 23:00:21 +0100
|
206
295
|
From: from@example.com
|
207
|
-
To:
|
208
|
-
Message-ID: <
|
296
|
+
To: teoZEEGzyVBVIj2vgFqIMQ@sample.com
|
297
|
+
Message-ID: <514399f5c6b38_44c53fed3546067434885@Richards-MacBook-Air.local.mail>
|
209
298
|
Subject: Password Reset
|
210
299
|
Mime-Version: 1.0
|
211
300
|
Content-Type: text/plain;
|
@@ -214,60 +303,62 @@ Content-Transfer-Encoding: 7bit
|
|
214
303
|
|
215
304
|
To reset your password, click the URL below.
|
216
305
|
|
217
|
-
http://localhost:3000/password_resets/
|
306
|
+
http://localhost:3000/password_resets/th8vz_BBAYn0r3440P4tMQ/edit
|
218
307
|
|
219
308
|
If you did not request your password to be reset, just ignore this email and your password will continue to stay the same.
|
220
309
|
Redirected to http://www.example.com/
|
221
|
-
Completed 302 Found in
|
222
|
-
Started GET "/" for 127.0.0.1 at 2013-03-
|
310
|
+
Completed 302 Found in 19ms (ActiveRecord: 1.3ms)
|
311
|
+
Started GET "/" for 127.0.0.1 at 2013-03-15 23:00:21 +0100
|
223
312
|
Processing by HomeController#index as HTML
|
224
|
-
Completed 200 OK in
|
225
|
-
Started GET "/password_resets/
|
313
|
+
Completed 200 OK in 1ms (Views: 1.2ms | ActiveRecord: 0.0ms)
|
314
|
+
Started GET "/password_resets/th8vz_BBAYn0r3440P4tMQ/edit" for 127.0.0.1 at 2013-03-17 01:00:00 +0100
|
226
315
|
Processing by PasswordResetsController#edit as HTML
|
227
|
-
Parameters: {"id"=>"
|
228
|
-
[1m[35mUser Load (0.0ms)[0m SELECT "users".* FROM "users" WHERE "users"."password_reset_token" = '
|
316
|
+
Parameters: {"id"=>"th8vz_BBAYn0r3440P4tMQ"}
|
317
|
+
[1m[35mUser Load (0.0ms)[0m SELECT "users".* FROM "users" WHERE "users"."password_reset_token" = 'th8vz_BBAYn0r3440P4tMQ' LIMIT 1
|
229
318
|
Completed 200 OK in 0ms (Views: 0.0ms | ActiveRecord: 0.0ms)
|
230
|
-
Started PATCH "/password_resets/
|
319
|
+
Started PATCH "/password_resets/th8vz_BBAYn0r3440P4tMQ" for 127.0.0.1 at 2013-03-17 01:00:00 +0100
|
231
320
|
Processing by PasswordResetsController#update as HTML
|
232
|
-
Parameters: {"utf8"=>"✓", "user"=>{"password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]"}, "commit"=>"Change password", "id"=>"
|
233
|
-
[1m[36mUser Load (0.0ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."password_reset_token" = '
|
321
|
+
Parameters: {"utf8"=>"✓", "user"=>{"password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]"}, "commit"=>"Change password", "id"=>"th8vz_BBAYn0r3440P4tMQ"}
|
322
|
+
[1m[36mUser Load (0.0ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."password_reset_token" = 'th8vz_BBAYn0r3440P4tMQ' LIMIT 1[0m
|
234
323
|
Redirected to http://localhost:3000/password_resets/new
|
235
324
|
Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
|
236
|
-
Started GET "/password_resets/new" for 127.0.0.1 at 2013-03-
|
325
|
+
Started GET "/password_resets/new" for 127.0.0.1 at 2013-03-17 01:00:00 +0100
|
237
326
|
Processing by PasswordResetsController#new as HTML
|
238
327
|
Completed 200 OK in 0ms (Views: 0.0ms | ActiveRecord: 0.0ms)
|
239
|
-
[1m[35m (
|
240
|
-
[1m[36m (0.
|
241
|
-
[1m[35m (0.
|
328
|
+
[1m[35m (0.8ms)[0m DELETE FROM "users";
|
329
|
+
[1m[36m (0.1ms)[0m [1mSELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';[0m
|
330
|
+
[1m[35m (0.5ms)[0m DELETE FROM sqlite_sequence where name = 'users';
|
242
331
|
-------------------------------------------------------------------------------------------
|
243
|
-
AuthproIntegrationTest:
|
332
|
+
AuthproIntegrationTest: test_reset_password_failing_because_we_enter_a_new_invalid_password
|
244
333
|
-------------------------------------------------------------------------------------------
|
245
334
|
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
246
335
|
[1m[35m (0.1ms)[0m begin transaction
|
247
|
-
[1m[36mUser Exists (0.
|
336
|
+
[1m[36mUser Exists (0.1ms)[0m [1mSELECT 1 AS one FROM "users" WHERE "users"."email" = 'T68MV_QN1sqJW4WyMs8jHg@sample.com' LIMIT 1[0m
|
337
|
+
[1m[35mUser Exists (0.1ms)[0m SELECT 1 AS one FROM "users" WHERE "users"."auth_token" = 'OWQePCs5igo4MHu7o4iksg' LIMIT 1
|
248
338
|
Binary data inserted for `string` type on column `password_digest`
|
249
|
-
[1m[
|
250
|
-
[1m[
|
251
|
-
Started GET "/login" for 127.0.0.1 at 2013-03-
|
339
|
+
[1m[36mSQL (0.4ms)[0m [1mINSERT INTO "users" ("auth_token", "created_at", "email", "password_digest", "updated_at") VALUES (?, ?, ?, ?, ?)[0m [["auth_token", "OWQePCs5igo4MHu7o4iksg"], ["created_at", Fri, 15 Mar 2013 22:00:21 UTC +00:00], ["email", "T68MV_QN1sqJW4WyMs8jHg@sample.com"], ["password_digest", "$2a$04$3wVtp2ZNpId0kay3mu36zOMHqixUsXugIhjsmOQtWbXsk4HI0imJq"], ["updated_at", Fri, 15 Mar 2013 22:00:21 UTC +00:00]]
|
340
|
+
[1m[35m (0.7ms)[0m commit transaction
|
341
|
+
Started GET "/login" for 127.0.0.1 at 2013-03-15 23:00:21 +0100
|
252
342
|
Processing by SessionsController#new as HTML
|
253
|
-
Completed 200 OK in 2ms (Views:
|
254
|
-
Started GET "/password_resets/new" for 127.0.0.1 at 2013-03-
|
343
|
+
Completed 200 OK in 2ms (Views: 1.5ms | ActiveRecord: 0.0ms)
|
344
|
+
Started GET "/password_resets/new" for 127.0.0.1 at 2013-03-15 23:00:21 +0100
|
255
345
|
Processing by PasswordResetsController#new as HTML
|
256
|
-
Completed 200 OK in
|
257
|
-
Started POST "/password_resets" for 127.0.0.1 at 2013-03-
|
346
|
+
Completed 200 OK in 1ms (Views: 1.3ms | ActiveRecord: 0.0ms)
|
347
|
+
Started POST "/password_resets" for 127.0.0.1 at 2013-03-15 23:00:21 +0100
|
258
348
|
Processing by PasswordResetsController#create as HTML
|
259
|
-
Parameters: {"utf8"=>"✓", "email"=>"
|
260
|
-
[1m[
|
261
|
-
[1m[
|
262
|
-
[1m[
|
263
|
-
[1m[
|
264
|
-
[1m[
|
349
|
+
Parameters: {"utf8"=>"✓", "email"=>"T68MV_QN1sqJW4WyMs8jHg@sample.com", "commit"=>"Reset password"}
|
350
|
+
[1m[36mUser Load (0.3ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."email" = 'T68MV_QN1sqJW4WyMs8jHg@sample.com' LIMIT 1[0m
|
351
|
+
[1m[35mUser Exists (0.1ms)[0m SELECT 1 AS one FROM "users" WHERE "users"."password_reset_token" = 'km2uOrLOS0gJDmgEVCzo5w' LIMIT 1
|
352
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
353
|
+
[1m[35mUser Exists (0.1ms)[0m SELECT 1 AS one FROM "users" WHERE ("users"."email" = 'T68MV_QN1sqJW4WyMs8jHg@sample.com' AND "users"."id" != 1) LIMIT 1
|
354
|
+
[1m[36mSQL (0.4ms)[0m [1mUPDATE "users" SET "password_reset_token" = ?, "password_reset_sent_at" = ?, "updated_at" = ? WHERE "users"."id" = 1[0m [["password_reset_token", "km2uOrLOS0gJDmgEVCzo5w"], ["password_reset_sent_at", Fri, 15 Mar 2013 22:00:21 UTC +00:00], ["updated_at", Fri, 15 Mar 2013 22:00:21 UTC +00:00]]
|
355
|
+
[1m[35m (0.6ms)[0m commit transaction
|
265
356
|
|
266
|
-
Sent mail to
|
267
|
-
Date:
|
357
|
+
Sent mail to T68MV_QN1sqJW4WyMs8jHg@sample.com (5.1ms)
|
358
|
+
Date: Fri, 15 Mar 2013 23:00:21 +0100
|
268
359
|
From: from@example.com
|
269
|
-
To:
|
270
|
-
Message-ID: <
|
360
|
+
To: T68MV_QN1sqJW4WyMs8jHg@sample.com
|
361
|
+
Message-ID: <514399f5daf96_44c53fed35460674349e4@Richards-MacBook-Air.local.mail>
|
271
362
|
Subject: Password Reset
|
272
363
|
Mime-Version: 1.0
|
273
364
|
Content-Type: text/plain;
|
@@ -276,179 +367,102 @@ Content-Transfer-Encoding: 7bit
|
|
276
367
|
|
277
368
|
To reset your password, click the URL below.
|
278
369
|
|
279
|
-
http://localhost:3000/password_resets/
|
370
|
+
http://localhost:3000/password_resets/km2uOrLOS0gJDmgEVCzo5w/edit
|
280
371
|
|
281
372
|
If you did not request your password to be reset, just ignore this email and your password will continue to stay the same.
|
282
373
|
Redirected to http://www.example.com/
|
283
|
-
Completed 302 Found in
|
284
|
-
Started GET "/" for 127.0.0.1 at 2013-03-
|
374
|
+
Completed 302 Found in 19ms (ActiveRecord: 1.6ms)
|
375
|
+
Started GET "/" for 127.0.0.1 at 2013-03-15 23:00:21 +0100
|
285
376
|
Processing by HomeController#index as HTML
|
286
|
-
Completed 200 OK in 1ms (Views: 1.
|
287
|
-
Started GET "/password_resets/
|
377
|
+
Completed 200 OK in 1ms (Views: 1.1ms | ActiveRecord: 0.0ms)
|
378
|
+
Started GET "/password_resets/km2uOrLOS0gJDmgEVCzo5w/edit" for 127.0.0.1 at 2013-03-15 23:00:21 +0100
|
288
379
|
Processing by PasswordResetsController#edit as HTML
|
289
|
-
Parameters: {"id"=>"
|
290
|
-
[1m[36mUser Load (0.
|
291
|
-
Completed 200 OK in 5ms (Views: 3.6ms | ActiveRecord: 0.3ms)
|
292
|
-
Started PATCH "/password_resets/C7DdTXwaSV2TXEdG1d_GhQ" for 127.0.0.1 at 2013-03-10 19:59:35 +0100
|
293
|
-
Processing by PasswordResetsController#update as HTML
|
294
|
-
Parameters: {"utf8"=>"✓", "user"=>{"password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]"}, "commit"=>"Change password", "id"=>"C7DdTXwaSV2TXEdG1d_GhQ"}
|
295
|
-
[1m[35mUser Load (0.2ms)[0m SELECT "users".* FROM "users" WHERE "users"."password_reset_token" = 'C7DdTXwaSV2TXEdG1d_GhQ' LIMIT 1
|
296
|
-
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
297
|
-
[1m[35m (0.1ms)[0m rollback transaction
|
298
|
-
Completed 200 OK in 10ms (Views: 4.4ms | ActiveRecord: 0.3ms)
|
299
|
-
[1m[36m (0.9ms)[0m [1mDELETE FROM "users";[0m
|
300
|
-
[1m[35m (0.2ms)[0m SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
|
301
|
-
[1m[36m (0.8ms)[0m [1mDELETE FROM sqlite_sequence where name = 'users';[0m
|
302
|
-
---------------------------------------
|
303
|
-
AuthproIntegrationTest: test_Visit_home
|
304
|
-
---------------------------------------
|
305
|
-
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
306
|
-
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
307
|
-
[1m[35mUser Exists (0.1ms)[0m SELECT 1 AS one FROM "users" WHERE "users"."auth_token" = 'j75kLa7QQDcOmUriTWZIMQ' LIMIT 1
|
308
|
-
Binary data inserted for `string` type on column `password_digest`
|
309
|
-
[1m[36mSQL (0.4ms)[0m [1mINSERT INTO "users" ("auth_token", "created_at", "email", "password_digest", "updated_at") VALUES (?, ?, ?, ?, ?)[0m [["auth_token", "j75kLa7QQDcOmUriTWZIMQ"], ["created_at", Sun, 10 Mar 2013 18:59:35 UTC +00:00], ["email", "master@example.com"], ["password_digest", "$2a$04$hMIXNvGgtap/tqTVHqLjSOcfPSfwIY0Fs6P5jPu/JGecWTEpWIjJK"], ["updated_at", Sun, 10 Mar 2013 18:59:35 UTC +00:00]]
|
310
|
-
[1m[35m (0.6ms)[0m commit transaction
|
311
|
-
Started GET "/" for 127.0.0.1 at 2013-03-10 19:59:35 +0100
|
312
|
-
Processing by HomeController#index as HTML
|
313
|
-
Completed 200 OK in 1ms (Views: 1.2ms | ActiveRecord: 0.0ms)
|
314
|
-
[1m[36m (0.8ms)[0m [1mDELETE FROM "users";[0m
|
315
|
-
[1m[35m (0.2ms)[0m SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
|
316
|
-
[1m[36m (0.7ms)[0m [1mDELETE FROM sqlite_sequence where name = 'users';[0m
|
317
|
-
----------------------------------
|
318
|
-
AuthproIntegrationTest: test_login
|
319
|
-
----------------------------------
|
320
|
-
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
321
|
-
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
322
|
-
[1m[35mUser Exists (0.1ms)[0m SELECT 1 AS one FROM "users" WHERE "users"."auth_token" = '38SQtvCfTeyASaJrTGiI7Q' LIMIT 1
|
323
|
-
Binary data inserted for `string` type on column `password_digest`
|
324
|
-
[1m[36mSQL (0.4ms)[0m [1mINSERT INTO "users" ("auth_token", "created_at", "email", "password_digest", "updated_at") VALUES (?, ?, ?, ?, ?)[0m [["auth_token", "38SQtvCfTeyASaJrTGiI7Q"], ["created_at", Sun, 10 Mar 2013 18:59:35 UTC +00:00], ["email", "master@example.com"], ["password_digest", "$2a$04$1iF9ZVX55IDn6FaBLOojauKUbkBHQe7kFq/PV45ht3vVUy5jAqtwS"], ["updated_at", Sun, 10 Mar 2013 18:59:35 UTC +00:00]]
|
325
|
-
[1m[35m (0.7ms)[0m commit transaction
|
326
|
-
Started GET "/" for 127.0.0.1 at 2013-03-10 19:59:35 +0100
|
327
|
-
Processing by HomeController#index as HTML
|
328
|
-
Completed 200 OK in 2ms (Views: 1.7ms | ActiveRecord: 0.0ms)
|
329
|
-
Started GET "/login" for 127.0.0.1 at 2013-03-10 19:59:35 +0100
|
330
|
-
Processing by SessionsController#new as HTML
|
331
|
-
Completed 200 OK in 2ms (Views: 2.0ms | ActiveRecord: 0.0ms)
|
332
|
-
Started POST "/sessions" for 127.0.0.1 at 2013-03-10 19:59:35 +0100
|
333
|
-
Processing by SessionsController#create as HTML
|
334
|
-
Parameters: {"utf8"=>"✓", "email"=>"master@example.com", "password"=>"[FILTERED]", "commit"=>"Log in"}
|
335
|
-
[1m[36mUser Load (0.2ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."email" = 'master@example.com' LIMIT 1[0m
|
336
|
-
Redirected to http://www.example.com/
|
337
|
-
Completed 302 Found in 3ms (ActiveRecord: 0.2ms)
|
338
|
-
Started GET "/" for 127.0.0.1 at 2013-03-10 19:59:35 +0100
|
339
|
-
Processing by HomeController#index as HTML
|
340
|
-
[1m[35mUser Load (0.2ms)[0m SELECT "users".* FROM "users" WHERE "users"."auth_token" = '38SQtvCfTeyASaJrTGiI7Q' LIMIT 1
|
380
|
+
Parameters: {"id"=>"km2uOrLOS0gJDmgEVCzo5w"}
|
381
|
+
[1m[36mUser Load (0.2ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."password_reset_token" = 'km2uOrLOS0gJDmgEVCzo5w' LIMIT 1[0m
|
341
382
|
Completed 200 OK in 4ms (Views: 3.2ms | ActiveRecord: 0.2ms)
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
AuthproIntegrationTest: test_login_failing
|
347
|
-
------------------------------------------
|
348
|
-
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
383
|
+
Started PATCH "/password_resets/km2uOrLOS0gJDmgEVCzo5w" for 127.0.0.1 at 2013-03-15 23:00:21 +0100
|
384
|
+
Processing by PasswordResetsController#update as HTML
|
385
|
+
Parameters: {"utf8"=>"✓", "user"=>{"password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]"}, "commit"=>"Change password", "id"=>"km2uOrLOS0gJDmgEVCzo5w"}
|
386
|
+
[1m[35mUser Load (0.2ms)[0m SELECT "users".* FROM "users" WHERE "users"."password_reset_token" = 'km2uOrLOS0gJDmgEVCzo5w' LIMIT 1
|
349
387
|
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
350
|
-
[1m[35mUser Exists (0.
|
351
|
-
|
352
|
-
|
353
|
-
[1m[35m (0.
|
354
|
-
|
355
|
-
|
356
|
-
Completed 200 OK in 2ms (Views: 1.6ms | ActiveRecord: 0.0ms)
|
357
|
-
Started GET "/login" for 127.0.0.1 at 2013-03-10 19:59:36 +0100
|
358
|
-
Processing by SessionsController#new as HTML
|
359
|
-
Completed 200 OK in 1ms (Views: 1.4ms | ActiveRecord: 0.0ms)
|
360
|
-
Started POST "/sessions" for 127.0.0.1 at 2013-03-10 19:59:36 +0100
|
361
|
-
Processing by SessionsController#create as HTML
|
362
|
-
Parameters: {"utf8"=>"✓", "email"=>"master@example.com", "password"=>"[FILTERED]", "commit"=>"Log in"}
|
363
|
-
[1m[36mUser Load (0.2ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."email" = 'master@example.com' LIMIT 1[0m
|
364
|
-
Completed 200 OK in 3ms (Views: 1.0ms | ActiveRecord: 0.2ms)
|
365
|
-
[1m[35m (0.9ms)[0m DELETE FROM "users";
|
366
|
-
[1m[36m (0.1ms)[0m [1mSELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';[0m
|
367
|
-
[1m[35m (0.6ms)[0m DELETE FROM sqlite_sequence where name = 'users';
|
368
|
-
-----------------------------------
|
369
|
-
AuthproIntegrationTest: test_logout
|
370
|
-
-----------------------------------
|
371
|
-
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
372
|
-
[1m[35m (0.1ms)[0m begin transaction
|
373
|
-
[1m[36mUser Exists (0.2ms)[0m [1mSELECT 1 AS one FROM "users" WHERE "users"."auth_token" = '7FkOowE4yAqewzbz3csIPA' LIMIT 1[0m
|
374
|
-
Binary data inserted for `string` type on column `password_digest`
|
375
|
-
[1m[35mSQL (0.6ms)[0m INSERT INTO "users" ("auth_token", "created_at", "email", "password_digest", "updated_at") VALUES (?, ?, ?, ?, ?) [["auth_token", "7FkOowE4yAqewzbz3csIPA"], ["created_at", Sun, 10 Mar 2013 18:59:36 UTC +00:00], ["email", "master@example.com"], ["password_digest", "$2a$04$viZrJsPglJgu8Iz/hsDiReZWFAxZuHwNtkyEuVy9o.cuwvJePO9NG"], ["updated_at", Sun, 10 Mar 2013 18:59:36 UTC +00:00]]
|
376
|
-
[1m[36m (0.7ms)[0m [1mcommit transaction[0m
|
377
|
-
Started GET "/login" for 127.0.0.1 at 2013-03-10 19:59:36 +0100
|
378
|
-
Processing by SessionsController#new as HTML
|
379
|
-
Completed 200 OK in 3ms (Views: 2.5ms | ActiveRecord: 0.0ms)
|
380
|
-
Started POST "/sessions" for 127.0.0.1 at 2013-03-10 19:59:36 +0100
|
381
|
-
Processing by SessionsController#create as HTML
|
382
|
-
Parameters: {"utf8"=>"✓", "email"=>"master@example.com", "password"=>"[FILTERED]", "commit"=>"Log in"}
|
383
|
-
[1m[35mUser Load (0.2ms)[0m SELECT "users".* FROM "users" WHERE "users"."email" = 'master@example.com' LIMIT 1
|
384
|
-
Redirected to http://www.example.com/
|
385
|
-
Completed 302 Found in 3ms (ActiveRecord: 0.2ms)
|
386
|
-
Started GET "/" for 127.0.0.1 at 2013-03-10 19:59:36 +0100
|
387
|
-
Processing by HomeController#index as HTML
|
388
|
-
[1m[36mUser Load (0.2ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."auth_token" = '7FkOowE4yAqewzbz3csIPA' LIMIT 1[0m
|
389
|
-
Completed 200 OK in 2ms (Views: 1.5ms | ActiveRecord: 0.2ms)
|
390
|
-
Started GET "/logout" for 127.0.0.1 at 2013-03-10 19:59:36 +0100
|
391
|
-
Processing by SessionsController#destroy as HTML
|
392
|
-
Redirected to http://www.example.com/
|
393
|
-
Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
|
394
|
-
Started GET "/" for 127.0.0.1 at 2013-03-10 19:59:36 +0100
|
395
|
-
Processing by HomeController#index as HTML
|
396
|
-
Completed 200 OK in 1ms (Views: 1.2ms | ActiveRecord: 0.0ms)
|
397
|
-
[1m[35m (1.0ms)[0m DELETE FROM "users";
|
398
|
-
[1m[36m (0.1ms)[0m [1mSELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';[0m
|
399
|
-
[1m[35m (0.6ms)[0m DELETE FROM sqlite_sequence where name = 'users';
|
388
|
+
[1m[35mUser Exists (0.1ms)[0m SELECT 1 AS one FROM "users" WHERE ("users"."email" = 'T68MV_QN1sqJW4WyMs8jHg@sample.com' AND "users"."id" != 1) LIMIT 1
|
389
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
390
|
+
Completed 200 OK in 10ms (Views: 4.0ms | ActiveRecord: 0.4ms)
|
391
|
+
[1m[35m (0.8ms)[0m DELETE FROM "users";
|
392
|
+
[1m[36m (0.2ms)[0m [1mSELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';[0m
|
393
|
+
[1m[35m (0.7ms)[0m DELETE FROM sqlite_sequence where name = 'users';
|
400
394
|
-----------------------------------
|
401
395
|
AuthproIntegrationTest: test_signup
|
402
396
|
-----------------------------------
|
403
397
|
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
404
398
|
[1m[35m (0.1ms)[0m begin transaction
|
405
|
-
[1m[36mUser Exists (0.1ms)[0m [1mSELECT 1 AS one FROM "users" WHERE "users"."
|
399
|
+
[1m[36mUser Exists (0.1ms)[0m [1mSELECT 1 AS one FROM "users" WHERE "users"."email" = 'DOqPRSk5UbbmzWysOrdRtA@sample.com' LIMIT 1[0m
|
400
|
+
[1m[35mUser Exists (0.1ms)[0m SELECT 1 AS one FROM "users" WHERE "users"."auth_token" = 'IiUiIHQaF487alDo3c4OlA' LIMIT 1
|
406
401
|
Binary data inserted for `string` type on column `password_digest`
|
407
|
-
[1m[
|
408
|
-
[1m[
|
409
|
-
Started GET "/" for 127.0.0.1 at 2013-03-
|
402
|
+
[1m[36mSQL (0.4ms)[0m [1mINSERT INTO "users" ("auth_token", "created_at", "email", "password_digest", "updated_at") VALUES (?, ?, ?, ?, ?)[0m [["auth_token", "IiUiIHQaF487alDo3c4OlA"], ["created_at", Fri, 15 Mar 2013 22:00:21 UTC +00:00], ["email", "DOqPRSk5UbbmzWysOrdRtA@sample.com"], ["password_digest", "$2a$04$DtmWtfmi20n7Ec5NHEtuc.HutyZiUQD6Q6a2ooeDW3TDweaM.MnrC"], ["updated_at", Fri, 15 Mar 2013 22:00:21 UTC +00:00]]
|
403
|
+
[1m[35m (0.6ms)[0m commit transaction
|
404
|
+
Started GET "/" for 127.0.0.1 at 2013-03-15 23:00:21 +0100
|
410
405
|
Processing by HomeController#index as HTML
|
411
|
-
Completed 200 OK in 2ms (Views: 1.
|
412
|
-
Started GET "/signup" for 127.0.0.1 at 2013-03-
|
406
|
+
Completed 200 OK in 2ms (Views: 1.3ms | ActiveRecord: 0.0ms)
|
407
|
+
Started GET "/signup" for 127.0.0.1 at 2013-03-15 23:00:21 +0100
|
413
408
|
Processing by UsersController#new as HTML
|
414
|
-
Completed 200 OK in
|
415
|
-
Started POST "/users" for 127.0.0.1 at 2013-03-
|
409
|
+
Completed 200 OK in 6ms (Views: 5.3ms | ActiveRecord: 0.0ms)
|
410
|
+
Started POST "/users" for 127.0.0.1 at 2013-03-15 23:00:22 +0100
|
416
411
|
Processing by UsersController#create as HTML
|
417
|
-
Parameters: {"utf8"=>"✓", "user"=>{"email"=>"
|
418
|
-
[1m[
|
419
|
-
[1m[
|
412
|
+
Parameters: {"utf8"=>"✓", "user"=>{"email"=>"rhpIV-6FEBLjOh81JR6ZXQ@sample.com", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]"}, "commit"=>"Sign up"}
|
413
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
414
|
+
[1m[35mUser Exists (0.2ms)[0m SELECT 1 AS one FROM "users" WHERE "users"."email" = 'rhpIV-6FEBLjOh81JR6ZXQ@sample.com' LIMIT 1
|
415
|
+
[1m[36mUser Exists (0.1ms)[0m [1mSELECT 1 AS one FROM "users" WHERE "users"."auth_token" = 'Jie0IcwtrXoH4dOcKRoi6g' LIMIT 1[0m
|
420
416
|
Binary data inserted for `string` type on column `password_digest`
|
421
|
-
[1m[35mSQL (0.5ms)[0m INSERT INTO "users" ("auth_token", "created_at", "email", "password_digest", "updated_at") VALUES (?, ?, ?, ?, ?) [["auth_token", "
|
417
|
+
[1m[35mSQL (0.5ms)[0m INSERT INTO "users" ("auth_token", "created_at", "email", "password_digest", "updated_at") VALUES (?, ?, ?, ?, ?) [["auth_token", "Jie0IcwtrXoH4dOcKRoi6g"], ["created_at", Fri, 15 Mar 2013 22:00:22 UTC +00:00], ["email", "rhpIV-6FEBLjOh81JR6ZXQ@sample.com"], ["password_digest", "$2a$04$9FG3fx9avT4mCfzds62EReon/AX601F220hevWJr14pS18DJ6fxC."], ["updated_at", Fri, 15 Mar 2013 22:00:22 UTC +00:00]]
|
422
418
|
[1m[36m (0.6ms)[0m [1mcommit transaction[0m
|
423
419
|
Redirected to http://www.example.com/
|
424
|
-
Completed 302 Found in
|
425
|
-
Started GET "/" for 127.0.0.1 at 2013-03-
|
420
|
+
Completed 302 Found in 6ms (ActiveRecord: 1.4ms)
|
421
|
+
Started GET "/" for 127.0.0.1 at 2013-03-15 23:00:22 +0100
|
426
422
|
Processing by HomeController#index as HTML
|
427
|
-
Completed 200 OK in 2ms (Views: 1.
|
428
|
-
[1m[35m (0.
|
429
|
-
[1m[36m (0.
|
423
|
+
Completed 200 OK in 2ms (Views: 1.5ms | ActiveRecord: 0.0ms)
|
424
|
+
[1m[35m (0.8ms)[0m DELETE FROM "users";
|
425
|
+
[1m[36m (0.1ms)[0m [1mSELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';[0m
|
430
426
|
[1m[35m (0.7ms)[0m DELETE FROM sqlite_sequence where name = 'users';
|
431
427
|
-------------------------------------------
|
432
428
|
AuthproIntegrationTest: test_signup_failing
|
433
429
|
-------------------------------------------
|
434
430
|
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
435
431
|
[1m[35m (0.1ms)[0m begin transaction
|
436
|
-
[1m[36mUser Exists (0.2ms)[0m [1mSELECT 1 AS one FROM "users" WHERE "users"."
|
432
|
+
[1m[36mUser Exists (0.2ms)[0m [1mSELECT 1 AS one FROM "users" WHERE "users"."email" = '8U8JQTCQL25b_9_sEsAx5A@sample.com' LIMIT 1[0m
|
433
|
+
[1m[35mUser Exists (0.1ms)[0m SELECT 1 AS one FROM "users" WHERE "users"."auth_token" = 'py4McJmUhYkpMXwE1iFSOQ' LIMIT 1
|
437
434
|
Binary data inserted for `string` type on column `password_digest`
|
438
|
-
[1m[
|
439
|
-
[1m[
|
440
|
-
Started GET "/" for 127.0.0.1 at 2013-03-
|
435
|
+
[1m[36mSQL (0.6ms)[0m [1mINSERT INTO "users" ("auth_token", "created_at", "email", "password_digest", "updated_at") VALUES (?, ?, ?, ?, ?)[0m [["auth_token", "py4McJmUhYkpMXwE1iFSOQ"], ["created_at", Fri, 15 Mar 2013 22:00:22 UTC +00:00], ["email", "8U8JQTCQL25b_9_sEsAx5A@sample.com"], ["password_digest", "$2a$04$ks7iBkyUO86bcU0P/Q0HU.euActFyGM08I12vZyLiUceTdSDvJsoO"], ["updated_at", Fri, 15 Mar 2013 22:00:22 UTC +00:00]]
|
436
|
+
[1m[35m (5.3ms)[0m commit transaction
|
437
|
+
Started GET "/" for 127.0.0.1 at 2013-03-15 23:00:22 +0100
|
441
438
|
Processing by HomeController#index as HTML
|
442
|
-
Completed 200 OK in
|
443
|
-
Started GET "/signup" for 127.0.0.1 at 2013-03-
|
439
|
+
Completed 200 OK in 1ms (Views: 1.1ms | ActiveRecord: 0.0ms)
|
440
|
+
Started GET "/signup" for 127.0.0.1 at 2013-03-15 23:00:22 +0100
|
444
441
|
Processing by UsersController#new as HTML
|
445
|
-
Completed 200 OK in
|
446
|
-
Started POST "/users" for 127.0.0.1 at 2013-03-
|
442
|
+
Completed 200 OK in 3ms (Views: 2.8ms | ActiveRecord: 0.0ms)
|
443
|
+
Started POST "/users" for 127.0.0.1 at 2013-03-15 23:00:22 +0100
|
447
444
|
Processing by UsersController#create as HTML
|
448
|
-
Parameters: {"utf8"=>"✓", "user"=>{"email"=>"
|
449
|
-
[1m[
|
450
|
-
[1m[
|
451
|
-
|
452
|
-
|
445
|
+
Parameters: {"utf8"=>"✓", "user"=>{"email"=>"ayW6Pnl9AYeL-ZHl53S_Rw@sample.com", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]"}, "commit"=>"Sign up"}
|
446
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
447
|
+
[1m[35mUser Exists (0.1ms)[0m SELECT 1 AS one FROM "users" WHERE "users"."email" = 'ayW6Pnl9AYeL-ZHl53S_Rw@sample.com' LIMIT 1
|
448
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
449
|
+
Completed 200 OK in 7ms (Views: 3.4ms | ActiveRecord: 0.2ms)
|
450
|
+
[1m[35m (1.4ms)[0m DELETE FROM "users";
|
453
451
|
[1m[36m (0.2ms)[0m [1mSELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';[0m
|
454
452
|
[1m[35m (0.7ms)[0m DELETE FROM sqlite_sequence where name = 'users';
|
453
|
+
---------------------------------------
|
454
|
+
AuthproIntegrationTest: test_visit_home
|
455
|
+
---------------------------------------
|
456
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
457
|
+
[1m[35m (0.1ms)[0m begin transaction
|
458
|
+
[1m[36mUser Exists (0.2ms)[0m [1mSELECT 1 AS one FROM "users" WHERE "users"."email" = 'TXBYzPfP5SQXAoltU0GqHg@sample.com' LIMIT 1[0m
|
459
|
+
[1m[35mUser Exists (0.1ms)[0m SELECT 1 AS one FROM "users" WHERE "users"."auth_token" = '8p_dHzD4ILD2EBzkMBreCg' LIMIT 1
|
460
|
+
Binary data inserted for `string` type on column `password_digest`
|
461
|
+
[1m[36mSQL (0.5ms)[0m [1mINSERT INTO "users" ("auth_token", "created_at", "email", "password_digest", "updated_at") VALUES (?, ?, ?, ?, ?)[0m [["auth_token", "8p_dHzD4ILD2EBzkMBreCg"], ["created_at", Fri, 15 Mar 2013 22:00:22 UTC +00:00], ["email", "TXBYzPfP5SQXAoltU0GqHg@sample.com"], ["password_digest", "$2a$04$agMm.NQejwkVHJBCu/BT/ezpvSb2eF0rGWWpOsPJ9alhQHcTuzfwq"], ["updated_at", Fri, 15 Mar 2013 22:00:22 UTC +00:00]]
|
462
|
+
[1m[35m (0.7ms)[0m commit transaction
|
463
|
+
Started GET "/" for 127.0.0.1 at 2013-03-15 23:00:22 +0100
|
464
|
+
Processing by HomeController#index as HTML
|
465
|
+
Completed 200 OK in 2ms (Views: 1.6ms | ActiveRecord: 0.0ms)
|
466
|
+
[1m[36m (1.5ms)[0m [1mDELETE FROM "users";[0m
|
467
|
+
[1m[35m (0.2ms)[0m SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
|
468
|
+
[1m[36m (0.7ms)[0m [1mDELETE FROM sqlite_sequence where name = 'users';[0m
|
@@ -5,11 +5,11 @@ one:
|
|
5
5
|
password_digest: MyString
|
6
6
|
auth_token: MyString
|
7
7
|
password_reset_token: MyString
|
8
|
-
password_reset_sent_at: 2013-03-
|
8
|
+
password_reset_sent_at: 2013-03-15 23:00:20
|
9
9
|
|
10
10
|
two:
|
11
11
|
email: MyString
|
12
12
|
password_digest: MyString
|
13
13
|
auth_token: MyString
|
14
14
|
password_reset_token: MyString
|
15
|
-
password_reset_sent_at: 2013-03-
|
15
|
+
password_reset_sent_at: 2013-03-15 23:00:20
|
data/test/test_helper.rb
CHANGED
@@ -12,6 +12,8 @@ require "capybara/rails"
|
|
12
12
|
require "database_cleaner"
|
13
13
|
require "timecop"
|
14
14
|
require "generators/authpro/authpro_generator"
|
15
|
+
require "turn"
|
16
|
+
require "securerandom"
|
15
17
|
|
16
18
|
Rails.backtrace_cleaner.remove_silencers!
|
17
19
|
|
@@ -29,3 +31,6 @@ class ActionDispatch::IntegrationTest
|
|
29
31
|
end
|
30
32
|
end
|
31
33
|
|
34
|
+
def fake_email
|
35
|
+
"#{SecureRandom.urlsafe_base64}@sample.com"
|
36
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: authpro
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Richard Nyström
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-03-
|
11
|
+
date: 2013-03-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -94,6 +94,20 @@ dependencies:
|
|
94
94
|
- - '>='
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: turn
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - '>='
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - '>='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
97
111
|
description: Simple Rails authentication generator for pros
|
98
112
|
email:
|
99
113
|
- ricny046@gmail.com
|
@@ -114,13 +128,13 @@ files:
|
|
114
128
|
- lib/generators/authpro/templates/password_resets_controller.rb
|
115
129
|
- lib/generators/authpro/templates/password_resets_edit.html.erb
|
116
130
|
- lib/generators/authpro/templates/sessions_controller.rb
|
117
|
-
- lib/generators/authpro/templates/user.rb
|
118
131
|
- lib/generators/authpro/templates/user_mailer.rb
|
119
132
|
- lib/generators/authpro/templates/users_controller.rb
|
120
133
|
- lib/generators/authpro/USAGE
|
121
134
|
- lib/tasks/authpro_tasks.rake
|
122
135
|
- MIT-LICENSE
|
123
136
|
- Rakefile
|
137
|
+
- README.md
|
124
138
|
- test/authpro_generator_test.rb
|
125
139
|
- test/authpro_integration_test.rb
|
126
140
|
- test/dummy/app/assets/javascripts/application.js
|
@@ -195,7 +209,7 @@ files:
|
|
195
209
|
- test/rails/dummy/config/locales/en.yml
|
196
210
|
- test/rails/dummy/config/routes.rb
|
197
211
|
- test/rails/dummy/config.ru
|
198
|
-
- test/rails/dummy/db/migrate/
|
212
|
+
- test/rails/dummy/db/migrate/20130315220020_create_users.rb
|
199
213
|
- test/rails/dummy/db/test.sqlite3
|
200
214
|
- test/rails/dummy/Gemfile
|
201
215
|
- test/rails/dummy/Gemfile.lock
|
@@ -313,7 +327,7 @@ test_files:
|
|
313
327
|
- test/rails/dummy/config/locales/en.yml
|
314
328
|
- test/rails/dummy/config/routes.rb
|
315
329
|
- test/rails/dummy/config.ru
|
316
|
-
- test/rails/dummy/db/migrate/
|
330
|
+
- test/rails/dummy/db/migrate/20130315220020_create_users.rb
|
317
331
|
- test/rails/dummy/db/test.sqlite3
|
318
332
|
- test/rails/dummy/Gemfile
|
319
333
|
- test/rails/dummy/Gemfile.lock
|
@@ -1,25 +0,0 @@
|
|
1
|
-
class User < ActiveRecord::Base
|
2
|
-
has_secure_password
|
3
|
-
|
4
|
-
validates_presence_of :password, on: :create
|
5
|
-
|
6
|
-
before_create { generate_token(:auth_token) }
|
7
|
-
|
8
|
-
def self.authenticate(email, password)
|
9
|
-
user = find_by email: email
|
10
|
-
user if user && user.authenticate(password)
|
11
|
-
end
|
12
|
-
|
13
|
-
def generate_token(column)
|
14
|
-
begin
|
15
|
-
self[column] = SecureRandom.urlsafe_base64
|
16
|
-
end while User.exists?(column => self[column])
|
17
|
-
end
|
18
|
-
|
19
|
-
def send_password_reset
|
20
|
-
generate_token(:password_reset_token)
|
21
|
-
self.password_reset_sent_at = Time.zone.now
|
22
|
-
save!
|
23
|
-
UserMailer.password_reset(self).deliver
|
24
|
-
end
|
25
|
-
end
|