authpro 0.1.0 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c0f2599c0163c3a7578cb89b7f650a77292515d8
4
- data.tar.gz: eb8cab72f96c3dd8b847146ffb99e5108e464a90
3
+ metadata.gz: f8675e043265670c37fd85f974167454e8e6899c
4
+ data.tar.gz: 51774bc01fb0cd836a5f99b84d3b283de4132066
5
5
  SHA512:
6
- metadata.gz: 00b8593ebe8a0759789eb5fd6fb9e7214b6a18c10d83a279afd8b88f5f21a0a2ae09e6be5ce6c9a36c76e14742a2ce85cb2faa29caa0800cb309c440fbe916ce
7
- data.tar.gz: 4256104fbeac2e17869bd1372a136ad5dc12f4a62f1e7e64ab60887a8fff80bb721ed87d5027dd84d5865a2c37d5e94f95f078012414c3c7075b06c47d04bc28
6
+ metadata.gz: 78745d8c4d4a8b9235c1738989b57feb45f834a3d0b8628037a405ef9ad21ee9a6e775a4c49dbfd8f2b0f7c6b5bbeb5d83113f3763165639446fff5602be202b
7
+ data.tar.gz: daecf5149374062c7970de50b52ffd221ce37492f363871d9bb73639259a4fd02e3dd31e864205e13e37e96f78749a44c86ec1c8479661f1e56e0110d6f5c65f
@@ -0,0 +1,49 @@
1
+ # Authpro - Rails 4 only at the moment
2
+
3
+ Work in progress but fully functional.
4
+
5
+ [![Code Climate](https://codeclimate.com/github/ricn/authpro.png)](https://codeclimate.com/github/ricn/authpro)
6
+ [![Build Status](https://travis-ci.org/ricn/authpro.png?branch=master)](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
@@ -1,3 +1,3 @@
1
1
  module Authpro
2
- VERSION = "0.1.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 copy_models
9
- copy_file "user.rb", "app/models/user.rb"
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.send_password_reset
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."
@@ -5,7 +5,7 @@ class AuthproGeneratorTest < Rails::Generators::TestCase
5
5
  tests AuthproGenerator
6
6
  destination File.expand_path(File.join(File.dirname(__FILE__), "rails", "dummy"))
7
7
 
8
- test "file creation" do
8
+ test "generated files" do
9
9
  run_generator(["--force"])
10
10
 
11
11
  # models
@@ -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: "master@example.com", password: "sekret123", password_confirmation: "sekret123")
10
+ @user = User.create!(email: fake_email, password: "sekret123", password_confirmation: "sekret123")
12
11
  end
13
12
 
14
- test "Visit home" do
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: "user@example.com"
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: "user@example.com"
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 "Reset password" do
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 "Reset password failing because email does not exist" do
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 "Reset password failing because we enter a new invalid password" do
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 "Reset password failing because of expiration" do
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.send_password_reset
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
- validates_presence_of :password, on: :create
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 send_password_reset
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
@@ -70,50 +70,138 @@ AuthproGeneratorTest: test_Assert_all_files_are_properly_created
70
70
  ----------------------------------------------------------------
71
71
   (0.3ms) begin transaction
72
72
   (0.1ms) rollback transaction
73
- ----------------------------------------
74
- AuthproGeneratorTest: test_file_creation
75
- ----------------------------------------
76
-  (0.2ms) begin transaction
77
-  (0.2ms) rollback transaction
78
- -------------------------------------------
79
- AuthproIntegrationTest: test_Reset_password
80
- -------------------------------------------
81
-  (0.9ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
82
-  (0.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
73
+ ------------------------------------------
74
+ AuthproGeneratorTest: test_generated_files
75
+ ------------------------------------------
76
+  (0.3ms) begin transaction
77
+  (0.1ms) rollback transaction
78
+ ----------------------------------
79
+ AuthproIntegrationTest: test_login
80
+ ----------------------------------
81
+  (1.0ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
82
+  (0.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
83
83
  ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
84
- Migrating to CreateUsers (20130310185934)
84
+ Migrating to CreateUsers (20130315220020)
85
85
   (0.1ms) begin transaction
86
-  (0.4ms) CREATE 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) 
87
- SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20130310185934"]]
86
+  (0.5ms) CREATE 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) 
87
+ SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20130315220020"]]
88
88
   (0.7ms) commit transaction
89
89
   (0.1ms) begin transaction
90
- User Exists (0.2ms) SELECT 1 AS one FROM "users" WHERE "users"."auth_token" = 'MbHLO-YZOyzHNbahzFPhUg' LIMIT 1
90
+ User Exists (0.2ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = 'kCP6EiM-UskBB7XszXO5ZQ@sample.com' LIMIT 1
91
+ User Exists (0.1ms) 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
+ SQL (39.9ms) INSERT INTO "users" ("auth_token", "created_at", "email", "password_digest", "updated_at") VALUES (?, ?, ?, ?, ?) [["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
+  (0.6ms) 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
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."email" = 'kCP6EiM-UskBB7XszXO5ZQ@sample.com' LIMIT 1
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
+ User Load (0.2ms) 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
+  (0.8ms) DELETE FROM "users";
115
+  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
116
+  (0.6ms) DELETE FROM sqlite_sequence where name = 'users';
117
+ ------------------------------------------
118
+ AuthproIntegrationTest: test_login_failing
119
+ ------------------------------------------
120
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
121
+  (0.1ms) begin transaction
122
+ User Exists (0.1ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = 'j7DiMyVZSNx-2BxkssD4uA@sample.com' LIMIT 1
123
+ User Exists (0.1ms) SELECT 1 AS one FROM "users" WHERE "users"."auth_token" = 'dndOqfUeGBRdwu37LeW2dQ' LIMIT 1
124
+ Binary data inserted for `string` type on column `password_digest`
125
+ SQL (0.4ms) 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
+  (8.7ms) commit transaction
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
+ User Load (0.2ms) 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
+  (0.9ms) DELETE FROM "users";
139
+  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
140
+  (14.1ms) DELETE FROM sqlite_sequence where name = 'users';
141
+ -----------------------------------
142
+ AuthproIntegrationTest: test_logout
143
+ -----------------------------------
144
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
145
+  (0.1ms) begin transaction
146
+ User Exists (0.1ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = 'nvry-P5gvxLsCYenTfZoAg@sample.com' LIMIT 1
147
+ User Exists (0.1ms) SELECT 1 AS one FROM "users" WHERE "users"."auth_token" = 'mXuKbMvevPDuz-RI3rn9yw' LIMIT 1
148
+ Binary data inserted for `string` type on column `password_digest`
149
+ SQL (0.4ms) 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
+  (0.6ms) commit transaction
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
+ User Load (0.2ms) 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
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."auth_token" = 'mXuKbMvevPDuz-RI3rn9yw' LIMIT 1
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
+  (0.9ms) DELETE FROM "users";
172
+  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
173
+  (0.7ms) DELETE FROM sqlite_sequence where name = 'users';
174
+ -------------------------------------------
175
+ AuthproIntegrationTest: test_reset_password
176
+ -------------------------------------------
177
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
178
+  (0.1ms) begin transaction
179
+ User Exists (0.1ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = 'xcfHKYjkhbBENzvZApGSvA@sample.com' LIMIT 1
180
+ User Exists (0.1ms) 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
- SQL (4.0ms) INSERT INTO "users" ("auth_token", "created_at", "email", "password_digest", "updated_at") VALUES (?, ?, ?, ?, ?) [["auth_token", "MbHLO-YZOyzHNbahzFPhUg"], ["created_at", Sun, 10 Mar 2013 18:59:34 UTC +00:00], ["email", "master@example.com"], ["password_digest", "$2a$04$alKfsqZvU3oa0R486ouYQuFJ5jTV9IjR.3jKQRyobORnOn6C61wmK"], ["updated_at", Sun, 10 Mar 2013 18:59:34 UTC +00:00]]
93
-  (2.0ms) commit transaction
94
- Started GET "/login" for 127.0.0.1 at 2013-03-10 19:59:35 +0100
182
+ SQL (0.4ms) INSERT INTO "users" ("auth_token", "created_at", "email", "password_digest", "updated_at") VALUES (?, ?, ?, ?, ?) [["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
+  (7.3ms) 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
- Rendered sessions/new.html.erb within layouts/application (2.2ms)
97
- Completed 200 OK in 35ms (Views: 34.4ms | ActiveRecord: 0.0ms)
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
- Rendered password_resets/new.html.erb within layouts/application (1.4ms)
101
- Completed 200 OK in 5ms (Views: 4.1ms | ActiveRecord: 0.0ms)
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"=>"master@example.com", "commit"=>"Reset password"}
105
- User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."email" = 'master@example.com' LIMIT 1
106
- User Exists (0.1ms) SELECT 1 AS one FROM "users" WHERE "users"."password_reset_token" = 'rwUNZ8Paq8QfXScL2ywhDQ' LIMIT 1
107
-  (0.0ms) begin transaction
108
- SQL (0.4ms) UPDATE "users" SET "password_reset_token" = ?, "password_reset_sent_at" = ?, "updated_at" = ? WHERE "users"."id" = 1 [["password_reset_token", "rwUNZ8Paq8QfXScL2ywhDQ"], ["password_reset_sent_at", Sun, 10 Mar 2013 18:59:35 UTC +00:00], ["updated_at", Sun, 10 Mar 2013 18:59:35 UTC +00:00]]
109
-  (0.9ms) commit transaction
110
- Rendered user_mailer/password_reset.text.erb (0.7ms)
192
+ Parameters: {"utf8"=>"✓", "email"=>"xcfHKYjkhbBENzvZApGSvA@sample.com", "commit"=>"Reset password"}
193
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."email" = 'xcfHKYjkhbBENzvZApGSvA@sample.com' LIMIT 1
194
+ User Exists (0.1ms) SELECT 1 AS one FROM "users" WHERE "users"."password_reset_token" = '26eCLpCa6kZIYuce2MJBsQ' LIMIT 1
195
+  (0.1ms) begin transaction
196
+ User Exists (0.1ms) SELECT 1 AS one FROM "users" WHERE ("users"."email" = 'xcfHKYjkhbBENzvZApGSvA@sample.com' AND "users"."id" != 1) LIMIT 1
197
+ SQL (0.5ms) UPDATE "users" SET "password_reset_token" = ?, "password_reset_sent_at" = ?, "updated_at" = ? WHERE "users"."id" = 1 [["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
+  (0.7ms) commit transaction
111
199
 
112
- Sent mail to master@example.com (10.8ms)
113
- Date: Sun, 10 Mar 2013 19:59:35 +0100
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: master@example.com
116
- Message-ID: <513cd817887bc_10cd93fce6a06066c3971c@Richards-MacBook-Air.local.mail>
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/rwUNZ8Paq8QfXScL2ywhDQ/edit
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 315ms (ActiveRecord: 1.7ms)
130
- Started GET "/" for 127.0.0.1 at 2013-03-10 19:59:35 +0100
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
- Rendered home/index.html.erb within layouts/application (0.3ms)
133
- Completed 200 OK in 3ms (Views: 2.6ms | ActiveRecord: 0.0ms)
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"=>"rwUNZ8Paq8QfXScL2ywhDQ"}
137
- User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."password_reset_token" = 'rwUNZ8Paq8QfXScL2ywhDQ' LIMIT 1
138
- Rendered password_resets/edit.html.erb within layouts/application (9.1ms)
139
- Completed 200 OK in 12ms (Views: 10.6ms | ActiveRecord: 0.2ms)
140
- Started PATCH "/password_resets/rwUNZ8Paq8QfXScL2ywhDQ" for 127.0.0.1 at 2013-03-10 19:59:35 +0100
223
+ Parameters: {"id"=>"26eCLpCa6kZIYuce2MJBsQ"}
224
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."password_reset_token" = '26eCLpCa6kZIYuce2MJBsQ' LIMIT 1
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"=>"rwUNZ8Paq8QfXScL2ywhDQ"}
143
- User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."password_reset_token" = 'rwUNZ8Paq8QfXScL2ywhDQ' LIMIT 1
228
+ Parameters: {"utf8"=>"✓", "user"=>{"password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]"}, "commit"=>"Change password", "id"=>"26eCLpCa6kZIYuce2MJBsQ"}
229
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."password_reset_token" = '26eCLpCa6kZIYuce2MJBsQ' LIMIT 1
144
230
   (0.1ms) begin transaction
231
+ User Exists (0.1ms) 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
- SQL (0.5ms) UPDATE "users" SET "password_digest" = ?, "updated_at" = ? WHERE "users"."id" = 1 [["password_digest", "$2a$04$JvS4g7RLpzV8aOrBuA76QOq2AdejeaM8qAaqWRhh2RjtYQxUwrFxm"], ["updated_at", Sun, 10 Mar 2013 18:59:35 UTC +00:00]]
147
-  (1.9ms) commit transaction
233
+ SQL (0.4ms) UPDATE "users" SET "password_digest" = ?, "updated_at" = ? WHERE "users"."id" = 1 [["password_digest", "$2a$04$p7/SUTUZcezfE2tbdaPJienaL9yUf426EsZ30rs1AI4/QFHOY4rPq"], ["updated_at", Fri, 15 Mar 2013 22:00:21 UTC +00:00]]
234
+  (0.6ms) commit transaction
148
235
  Redirected to http://localhost:3000/
149
- Completed 302 Found in 7ms (ActiveRecord: 2.7ms)
150
- Started GET "/" for 127.0.0.1 at 2013-03-10 19:59:35 +0100
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
- Rendered home/index.html.erb within layouts/application (0.1ms)
153
- Completed 200 OK in 2ms (Views: 1.7ms | ActiveRecord: 0.0ms)
154
-  (0.8ms) DELETE FROM "users";
155
-  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
156
-  (0.7ms) DELETE FROM sqlite_sequence where name = 'users';
239
+ Completed 200 OK in 2ms (Views: 1.6ms | ActiveRecord: 0.0ms)
240
+  (0.9ms) DELETE FROM "users";
241
+  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
242
+  (0.7ms) DELETE FROM sqlite_sequence where name = 'users';
157
243
  --------------------------------------------------------------------------------
158
- AuthproIntegrationTest: test_Reset_password_failing_because_email_does_not_exist
244
+ AuthproIntegrationTest: test_reset_password_failing_because_email_does_not_exist
159
245
  --------------------------------------------------------------------------------
160
- ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
161
-  (0.1ms) begin transaction
162
- User Exists (0.2ms) SELECT 1 AS one FROM "users" WHERE "users"."auth_token" = '_WTx2Jw-M7YpzGjXr1UPhg' LIMIT 1
246
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
247
+  (0.1ms) begin transaction
248
+ User Exists (0.1ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = 'MHnlXv3IQolWCjJwCHUmmQ@sample.com' LIMIT 1
249
+ User Exists (0.1ms) SELECT 1 AS one FROM "users" WHERE "users"."auth_token" = 'JRlpzQu09zhBYyR0kfF1dg' LIMIT 1
163
250
  Binary data inserted for `string` type on column `password_digest`
164
- SQL (0.6ms) INSERT INTO "users" ("auth_token", "created_at", "email", "password_digest", "updated_at") VALUES (?, ?, ?, ?, ?) [["auth_token", "_WTx2Jw-M7YpzGjXr1UPhg"], ["created_at", Sun, 10 Mar 2013 18:59:35 UTC +00:00], ["email", "master@example.com"], ["password_digest", "$2a$04$0MQtsssNIBjEdcL5onkxeegh8omFYHeP1dQuE7Ijh5NGE2TjFA3Na"], ["updated_at", Sun, 10 Mar 2013 18:59:35 UTC +00:00]]
165
-  (0.7ms) commit transaction
166
- Started GET "/login" for 127.0.0.1 at 2013-03-10 19:59:35 +0100
251
+ SQL (0.4ms) 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
+  (0.6ms) commit transaction
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.6ms | ActiveRecord: 0.0ms)
169
- Started GET "/password_resets/new" for 127.0.0.1 at 2013-03-10 19:59:35 +0100
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.1ms | ActiveRecord: 0.0ms)
172
- Started POST "/password_resets" for 127.0.0.1 at 2013-03-10 19:59:35 +0100
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
  User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."email" = 'nosense@example.com' LIMIT 1
176
- Completed 200 OK in 2ms (Views: 0.9ms | ActiveRecord: 0.2ms)
177
-  (1.0ms) DELETE FROM "users";
178
-  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
179
-  (0.8ms) DELETE FROM sqlite_sequence where name = 'users';
263
+ Completed 200 OK in 3ms (Views: 1.4ms | ActiveRecord: 0.2ms)
264
+  (0.8ms) DELETE FROM "users";
265
+  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
266
+  (0.5ms) DELETE FROM sqlite_sequence where name = 'users';
180
267
  -------------------------------------------------------------------------
181
- AuthproIntegrationTest: test_Reset_password_failing_because_of_expiration
268
+ AuthproIntegrationTest: test_reset_password_failing_because_of_expiration
182
269
  -------------------------------------------------------------------------
183
270
  ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
184
271
   (0.1ms) begin transaction
185
- User Exists (0.2ms) SELECT 1 AS one FROM "users" WHERE "users"."auth_token" = 'xNeIDABf52hgjYcqO9OgfA' LIMIT 1
272
+ User Exists (0.2ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = 'teoZEEGzyVBVIj2vgFqIMQ@sample.com' LIMIT 1
273
+ User Exists (0.1ms) SELECT 1 AS one FROM "users" WHERE "users"."auth_token" = '3iD_C38FXAZJxtd08aXrGQ' LIMIT 1
186
274
  Binary data inserted for `string` type on column `password_digest`
187
- SQL (0.6ms) INSERT INTO "users" ("auth_token", "created_at", "email", "password_digest", "updated_at") VALUES (?, ?, ?, ?, ?) [["auth_token", "xNeIDABf52hgjYcqO9OgfA"], ["created_at", Sun, 10 Mar 2013 18:59:35 UTC +00:00], ["email", "master@example.com"], ["password_digest", "$2a$04$Eh..RtTMn60k4u6tj3H3huB9NF7Fn0MZqvMXepH24UuWotM6rf4by"], ["updated_at", Sun, 10 Mar 2013 18:59:35 UTC +00:00]]
188
-  (0.6ms) commit transaction
189
- Started GET "/login" for 127.0.0.1 at 2013-03-10 19:59:35 +0100
275
+ SQL (0.3ms) 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
+  (0.6ms) commit transaction
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 3ms (Views: 2.6ms | ActiveRecord: 0.0ms)
192
- Started GET "/password_resets/new" for 127.0.0.1 at 2013-03-10 19:59:35 +0100
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.5ms | ActiveRecord: 0.0ms)
195
- Started POST "/password_resets" for 127.0.0.1 at 2013-03-10 19:59:35 +0100
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"=>"master@example.com", "commit"=>"Reset password"}
198
- User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."email" = 'master@example.com' LIMIT 1
199
- User Exists (0.1ms) SELECT 1 AS one FROM "users" WHERE "users"."password_reset_token" = '74c4KNPKymdviRnH_XHn_Q' LIMIT 1
200
-  (0.0ms) begin transaction
201
- SQL (0.3ms) UPDATE "users" SET "password_reset_token" = ?, "password_reset_sent_at" = ?, "updated_at" = ? WHERE "users"."id" = 1 [["password_reset_token", "74c4KNPKymdviRnH_XHn_Q"], ["password_reset_sent_at", Sun, 10 Mar 2013 18:59:35 UTC +00:00], ["updated_at", Sun, 10 Mar 2013 18:59:35 UTC +00:00]]
202
-  (0.7ms) commit transaction
285
+ Parameters: {"utf8"=>"✓", "email"=>"teoZEEGzyVBVIj2vgFqIMQ@sample.com", "commit"=>"Reset password"}
286
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."email" = 'teoZEEGzyVBVIj2vgFqIMQ@sample.com' LIMIT 1
287
+ User Exists (0.1ms) SELECT 1 AS one FROM "users" WHERE "users"."password_reset_token" = 'th8vz_BBAYn0r3440P4tMQ' LIMIT 1
288
+  (0.1ms) begin transaction
289
+ User Exists (0.1ms) SELECT 1 AS one FROM "users" WHERE ("users"."email" = 'teoZEEGzyVBVIj2vgFqIMQ@sample.com' AND "users"."id" != 1) LIMIT 1
290
+ SQL (0.3ms) 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
+  (0.6ms) commit transaction
203
292
 
204
- Sent mail to master@example.com (8.1ms)
205
- Date: Sun, 10 Mar 2013 19:59:35 +0100
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: master@example.com
208
- Message-ID: <513cd817affd2_10cd93fce6a06066c39814@Richards-MacBook-Air.local.mail>
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/74c4KNPKymdviRnH_XHn_Q/edit
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 23ms (ActiveRecord: 1.3ms)
222
- Started GET "/" for 127.0.0.1 at 2013-03-10 19:59:35 +0100
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 2ms (Views: 2.1ms | ActiveRecord: 0.0ms)
225
- Started GET "/password_resets/74c4KNPKymdviRnH_XHn_Q/edit" for 127.0.0.1 at 2013-03-12 01:00:00 +0100
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"=>"74c4KNPKymdviRnH_XHn_Q"}
228
- User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."password_reset_token" = '74c4KNPKymdviRnH_XHn_Q' LIMIT 1
316
+ Parameters: {"id"=>"th8vz_BBAYn0r3440P4tMQ"}
317
+ User Load (0.0ms) 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/74c4KNPKymdviRnH_XHn_Q" for 127.0.0.1 at 2013-03-12 01:00:00 +0100
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"=>"74c4KNPKymdviRnH_XHn_Q"}
233
- User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."password_reset_token" = '74c4KNPKymdviRnH_XHn_Q' LIMIT 1
321
+ Parameters: {"utf8"=>"✓", "user"=>{"password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]"}, "commit"=>"Change password", "id"=>"th8vz_BBAYn0r3440P4tMQ"}
322
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."password_reset_token" = 'th8vz_BBAYn0r3440P4tMQ' LIMIT 1
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-12 01:00:00 +0100
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
-  (1.1ms) DELETE FROM "users";
240
-  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
241
-  (0.7ms) DELETE FROM sqlite_sequence where name = 'users';
328
+  (0.8ms) DELETE FROM "users";
329
+  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
330
+  (0.5ms) DELETE FROM sqlite_sequence where name = 'users';
242
331
  -------------------------------------------------------------------------------------------
243
- AuthproIntegrationTest: test_Reset_password_failing_because_we_enter_a_new_invalid_password
332
+ AuthproIntegrationTest: test_reset_password_failing_because_we_enter_a_new_invalid_password
244
333
  -------------------------------------------------------------------------------------------
245
334
  ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
246
335
   (0.1ms) begin transaction
247
- User Exists (0.2ms) SELECT 1 AS one FROM "users" WHERE "users"."auth_token" = 'xQ3rW4GHCcr5UE37dGDo9g' LIMIT 1
336
+ User Exists (0.1ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = 'T68MV_QN1sqJW4WyMs8jHg@sample.com' LIMIT 1
337
+ User Exists (0.1ms) 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
- SQL (0.5ms) INSERT INTO "users" ("auth_token", "created_at", "email", "password_digest", "updated_at") VALUES (?, ?, ?, ?, ?) [["auth_token", "xQ3rW4GHCcr5UE37dGDo9g"], ["created_at", Sun, 10 Mar 2013 18:59:35 UTC +00:00], ["email", "master@example.com"], ["password_digest", "$2a$04$gr1nF/wAklyo2HH3cphoJ.vHGnk9WEmwMurblY/7iJwpoYdPezsHy"], ["updated_at", Sun, 10 Mar 2013 18:59:35 UTC +00:00]]
250
-  (0.7ms) commit transaction
251
- Started GET "/login" for 127.0.0.1 at 2013-03-10 19:59:35 +0100
339
+ SQL (0.4ms) INSERT INTO "users" ("auth_token", "created_at", "email", "password_digest", "updated_at") VALUES (?, ?, ?, ?, ?) [["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
+  (0.7ms) 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: 2.3ms | ActiveRecord: 0.0ms)
254
- Started GET "/password_resets/new" for 127.0.0.1 at 2013-03-10 19:59:35 +0100
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 2ms (Views: 1.8ms | ActiveRecord: 0.0ms)
257
- Started POST "/password_resets" for 127.0.0.1 at 2013-03-10 19:59:35 +0100
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"=>"master@example.com", "commit"=>"Reset password"}
260
- User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."email" = 'master@example.com' LIMIT 1
261
- User Exists (0.1ms) SELECT 1 AS one FROM "users" WHERE "users"."password_reset_token" = 'C7DdTXwaSV2TXEdG1d_GhQ' LIMIT 1
262
-  (0.0ms) begin transaction
263
- SQL (0.3ms) UPDATE "users" SET "password_reset_token" = ?, "password_reset_sent_at" = ?, "updated_at" = ? WHERE "users"."id" = 1 [["password_reset_token", "C7DdTXwaSV2TXEdG1d_GhQ"], ["password_reset_sent_at", Sun, 10 Mar 2013 18:59:35 UTC +00:00], ["updated_at", Sun, 10 Mar 2013 18:59:35 UTC +00:00]]
264
-  (0.5ms) commit transaction
349
+ Parameters: {"utf8"=>"✓", "email"=>"T68MV_QN1sqJW4WyMs8jHg@sample.com", "commit"=>"Reset password"}
350
+ User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."email" = 'T68MV_QN1sqJW4WyMs8jHg@sample.com' LIMIT 1
351
+ User Exists (0.1ms) SELECT 1 AS one FROM "users" WHERE "users"."password_reset_token" = 'km2uOrLOS0gJDmgEVCzo5w' LIMIT 1
352
+  (0.1ms) begin transaction
353
+ User Exists (0.1ms) SELECT 1 AS one FROM "users" WHERE ("users"."email" = 'T68MV_QN1sqJW4WyMs8jHg@sample.com' AND "users"."id" != 1) LIMIT 1
354
+ SQL (0.4ms) UPDATE "users" SET "password_reset_token" = ?, "password_reset_sent_at" = ?, "updated_at" = ? WHERE "users"."id" = 1 [["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
+  (0.6ms) commit transaction
265
356
 
266
- Sent mail to master@example.com (5.4ms)
267
- Date: Sun, 10 Mar 2013 19:59:35 +0100
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: master@example.com
270
- Message-ID: <513cd817d2655_10cd93fce6a06066c39930@Richards-MacBook-Air.local.mail>
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/C7DdTXwaSV2TXEdG1d_GhQ/edit
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 14ms (ActiveRecord: 1.1ms)
284
- Started GET "/" for 127.0.0.1 at 2013-03-10 19:59:35 +0100
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.0ms | ActiveRecord: 0.0ms)
287
- Started GET "/password_resets/C7DdTXwaSV2TXEdG1d_GhQ/edit" for 127.0.0.1 at 2013-03-10 19:59:35 +0100
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"=>"C7DdTXwaSV2TXEdG1d_GhQ"}
290
- User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."password_reset_token" = 'C7DdTXwaSV2TXEdG1d_GhQ' LIMIT 1
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
- User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."password_reset_token" = 'C7DdTXwaSV2TXEdG1d_GhQ' LIMIT 1
296
-  (0.1ms) begin transaction
297
-  (0.1ms) rollback transaction
298
- Completed 200 OK in 10ms (Views: 4.4ms | ActiveRecord: 0.3ms)
299
-  (0.9ms) DELETE FROM "users";
300
-  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
301
-  (0.8ms) DELETE FROM sqlite_sequence where name = 'users';
302
- ---------------------------------------
303
- AuthproIntegrationTest: test_Visit_home
304
- ---------------------------------------
305
- ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
306
-  (0.1ms) begin transaction
307
- User Exists (0.1ms) 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
- SQL (0.4ms) INSERT INTO "users" ("auth_token", "created_at", "email", "password_digest", "updated_at") VALUES (?, ?, ?, ?, ?) [["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
-  (0.6ms) 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
-  (0.8ms) DELETE FROM "users";
315
-  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
316
-  (0.7ms) DELETE FROM sqlite_sequence where name = 'users';
317
- ----------------------------------
318
- AuthproIntegrationTest: test_login
319
- ----------------------------------
320
- ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
321
-  (0.1ms) begin transaction
322
- User Exists (0.1ms) 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
- SQL (0.4ms) INSERT INTO "users" ("auth_token", "created_at", "email", "password_digest", "updated_at") VALUES (?, ?, ?, ?, ?) [["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
-  (0.7ms) 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
- User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."email" = 'master@example.com' LIMIT 1
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
- User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."auth_token" = '38SQtvCfTeyASaJrTGiI7Q' LIMIT 1
380
+ Parameters: {"id"=>"km2uOrLOS0gJDmgEVCzo5w"}
381
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."password_reset_token" = 'km2uOrLOS0gJDmgEVCzo5w' LIMIT 1
341
382
  Completed 200 OK in 4ms (Views: 3.2ms | ActiveRecord: 0.2ms)
342
-  (1.4ms) DELETE FROM "users";
343
-  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
344
-  (0.6ms) DELETE FROM sqlite_sequence where name = 'users';
345
- ------------------------------------------
346
- AuthproIntegrationTest: test_login_failing
347
- ------------------------------------------
348
- ActiveRecord::SchemaMigration Load (0.1ms) 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
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."password_reset_token" = 'km2uOrLOS0gJDmgEVCzo5w' LIMIT 1
349
387
   (0.1ms) begin transaction
350
- User Exists (0.2ms) SELECT 1 AS one FROM "users" WHERE "users"."auth_token" = 'hRwWRJO6ymNzgKrUGDi3Iw' LIMIT 1
351
- Binary data inserted for `string` type on column `password_digest`
352
- SQL (0.5ms) INSERT INTO "users" ("auth_token", "created_at", "email", "password_digest", "updated_at") VALUES (?, ?, ?, ?, ?) [["auth_token", "hRwWRJO6ymNzgKrUGDi3Iw"], ["created_at", Sun, 10 Mar 2013 18:59:36 UTC +00:00], ["email", "master@example.com"], ["password_digest", "$2a$04$MSEgUl8ue6UmyDsBnFK.HOG6tmSSNsNZggM.CYxOTa0JDcs9YGEZW"], ["updated_at", Sun, 10 Mar 2013 18:59:36 UTC +00:00]]
353
-  (0.7ms) commit transaction
354
- Started GET "/" for 127.0.0.1 at 2013-03-10 19:59:36 +0100
355
- Processing by HomeController#index as HTML
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
- User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."email" = 'master@example.com' LIMIT 1
364
- Completed 200 OK in 3ms (Views: 1.0ms | ActiveRecord: 0.2ms)
365
-  (0.9ms) DELETE FROM "users";
366
-  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
367
-  (0.6ms) DELETE FROM sqlite_sequence where name = 'users';
368
- -----------------------------------
369
- AuthproIntegrationTest: test_logout
370
- -----------------------------------
371
- ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
372
-  (0.1ms) begin transaction
373
- User Exists (0.2ms) SELECT 1 AS one FROM "users" WHERE "users"."auth_token" = '7FkOowE4yAqewzbz3csIPA' LIMIT 1
374
- Binary data inserted for `string` type on column `password_digest`
375
- SQL (0.6ms) 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
-  (0.7ms) commit transaction
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
- User Load (0.2ms) 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
- User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."auth_token" = '7FkOowE4yAqewzbz3csIPA' LIMIT 1
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
-  (1.0ms) DELETE FROM "users";
398
-  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
399
-  (0.6ms) DELETE FROM sqlite_sequence where name = 'users';
388
+ User Exists (0.1ms) SELECT 1 AS one FROM "users" WHERE ("users"."email" = 'T68MV_QN1sqJW4WyMs8jHg@sample.com' AND "users"."id" != 1) LIMIT 1
389
+  (0.1ms) rollback transaction
390
+ Completed 200 OK in 10ms (Views: 4.0ms | ActiveRecord: 0.4ms)
391
+  (0.8ms) DELETE FROM "users";
392
+  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
393
+  (0.7ms) DELETE FROM sqlite_sequence where name = 'users';
400
394
  -----------------------------------
401
395
  AuthproIntegrationTest: test_signup
402
396
  -----------------------------------
403
397
  ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
404
398
   (0.1ms) begin transaction
405
- User Exists (0.1ms) SELECT 1 AS one FROM "users" WHERE "users"."auth_token" = 'luH8NfFX6Ry-am7BKJoWLA' LIMIT 1
399
+ User Exists (0.1ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = 'DOqPRSk5UbbmzWysOrdRtA@sample.com' LIMIT 1
400
+ User Exists (0.1ms) 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
- SQL (0.4ms) INSERT INTO "users" ("auth_token", "created_at", "email", "password_digest", "updated_at") VALUES (?, ?, ?, ?, ?) [["auth_token", "luH8NfFX6Ry-am7BKJoWLA"], ["created_at", Sun, 10 Mar 2013 18:59:36 UTC +00:00], ["email", "master@example.com"], ["password_digest", "$2a$04$6S7XvTMDqWH1yQXIceCRw.AQL.9ISrX1wI.lnLS8ibLfF3xPlKpA2"], ["updated_at", Sun, 10 Mar 2013 18:59:36 UTC +00:00]]
408
-  (0.6ms) commit transaction
409
- Started GET "/" for 127.0.0.1 at 2013-03-10 19:59:36 +0100
402
+ SQL (0.4ms) INSERT INTO "users" ("auth_token", "created_at", "email", "password_digest", "updated_at") VALUES (?, ?, ?, ?, ?) [["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
+  (0.6ms) 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.6ms | ActiveRecord: 0.0ms)
412
- Started GET "/signup" for 127.0.0.1 at 2013-03-10 19:59:36 +0100
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 7ms (Views: 6.0ms | ActiveRecord: 0.0ms)
415
- Started POST "/users" for 127.0.0.1 at 2013-03-10 19:59:36 +0100
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"=>"user@example.com", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]"}, "commit"=>"Sign up"}
418
-  (0.1ms) begin transaction
419
- User Exists (0.2ms) SELECT 1 AS one FROM "users" WHERE "users"."auth_token" = 'AGOT15DNXOXfFPjvsxOzcQ' LIMIT 1
412
+ Parameters: {"utf8"=>"✓", "user"=>{"email"=>"rhpIV-6FEBLjOh81JR6ZXQ@sample.com", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]"}, "commit"=>"Sign up"}
413
+  (0.1ms) begin transaction
414
+ User Exists (0.2ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = 'rhpIV-6FEBLjOh81JR6ZXQ@sample.com' LIMIT 1
415
+ User Exists (0.1ms) SELECT 1 AS one FROM "users" WHERE "users"."auth_token" = 'Jie0IcwtrXoH4dOcKRoi6g' LIMIT 1
420
416
  Binary data inserted for `string` type on column `password_digest`
421
- SQL (0.5ms) INSERT INTO "users" ("auth_token", "created_at", "email", "password_digest", "updated_at") VALUES (?, ?, ?, ?, ?) [["auth_token", "AGOT15DNXOXfFPjvsxOzcQ"], ["created_at", Sun, 10 Mar 2013 18:59:36 UTC +00:00], ["email", "user@example.com"], ["password_digest", "$2a$04$x1AtR9S0qh7/izyRjGrkhu4tukFbnB4ER02f2rPs3SnY6JAH3HXMe"], ["updated_at", Sun, 10 Mar 2013 18:59:36 UTC +00:00]]
417
+ SQL (0.5ms) 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
   (0.6ms) commit transaction
423
419
  Redirected to http://www.example.com/
424
- Completed 302 Found in 7ms (ActiveRecord: 1.4ms)
425
- Started GET "/" for 127.0.0.1 at 2013-03-10 19:59:36 +0100
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.6ms | ActiveRecord: 0.0ms)
428
-  (0.9ms) DELETE FROM "users";
429
-  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
423
+ Completed 200 OK in 2ms (Views: 1.5ms | ActiveRecord: 0.0ms)
424
+  (0.8ms) DELETE FROM "users";
425
+  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
430
426
   (0.7ms) DELETE FROM sqlite_sequence where name = 'users';
431
427
  -------------------------------------------
432
428
  AuthproIntegrationTest: test_signup_failing
433
429
  -------------------------------------------
434
430
  ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
435
431
   (0.1ms) begin transaction
436
- User Exists (0.2ms) SELECT 1 AS one FROM "users" WHERE "users"."auth_token" = 'MO3DpEL67SwdYWGpsbgNuw' LIMIT 1
432
+ User Exists (0.2ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = '8U8JQTCQL25b_9_sEsAx5A@sample.com' LIMIT 1
433
+ User Exists (0.1ms) 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
- SQL (0.6ms) INSERT INTO "users" ("auth_token", "created_at", "email", "password_digest", "updated_at") VALUES (?, ?, ?, ?, ?) [["auth_token", "MO3DpEL67SwdYWGpsbgNuw"], ["created_at", Sun, 10 Mar 2013 18:59:36 UTC +00:00], ["email", "master@example.com"], ["password_digest", "$2a$04$s1KsglI5FePMO5LPlOCvUuQytn44OP4gfXQ2ctd4IKUAcGkFV3OMm"], ["updated_at", Sun, 10 Mar 2013 18:59:36 UTC +00:00]]
439
-  (2.4ms) commit transaction
440
- Started GET "/" for 127.0.0.1 at 2013-03-10 19:59:36 +0100
435
+ SQL (0.6ms) INSERT INTO "users" ("auth_token", "created_at", "email", "password_digest", "updated_at") VALUES (?, ?, ?, ?, ?) [["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
+  (5.3ms) 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 16ms (Views: 15.6ms | ActiveRecord: 0.0ms)
443
- Started GET "/signup" for 127.0.0.1 at 2013-03-10 19:59:36 +0100
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 5ms (Views: 4.8ms | ActiveRecord: 0.0ms)
446
- Started POST "/users" for 127.0.0.1 at 2013-03-10 19:59:36 +0100
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"=>"user@example.com", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]"}, "commit"=>"Sign up"}
449
-  (0.1ms) begin transaction
450
-  (0.1ms) rollback transaction
451
- Completed 200 OK in 9ms (Views: 4.5ms | ActiveRecord: 0.2ms)
452
-  (0.9ms) DELETE FROM "users";
445
+ Parameters: {"utf8"=>"✓", "user"=>{"email"=>"ayW6Pnl9AYeL-ZHl53S_Rw@sample.com", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]"}, "commit"=>"Sign up"}
446
+  (0.1ms) begin transaction
447
+ User Exists (0.1ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = 'ayW6Pnl9AYeL-ZHl53S_Rw@sample.com' LIMIT 1
448
+  (0.0ms) rollback transaction
449
+ Completed 200 OK in 7ms (Views: 3.4ms | ActiveRecord: 0.2ms)
450
+  (1.4ms) DELETE FROM "users";
453
451
   (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
454
452
   (0.7ms) DELETE FROM sqlite_sequence where name = 'users';
453
+ ---------------------------------------
454
+ AuthproIntegrationTest: test_visit_home
455
+ ---------------------------------------
456
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
457
+  (0.1ms) begin transaction
458
+ User Exists (0.2ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = 'TXBYzPfP5SQXAoltU0GqHg@sample.com' LIMIT 1
459
+ User Exists (0.1ms) 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
+ SQL (0.5ms) INSERT INTO "users" ("auth_token", "created_at", "email", "password_digest", "updated_at") VALUES (?, ?, ?, ?, ?) [["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
+  (0.7ms) 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
+  (1.5ms) DELETE FROM "users";
467
+  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
468
+  (0.7ms) DELETE FROM sqlite_sequence where name = 'users';
@@ -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-10 19:59:34
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-10 19:59:34
15
+ password_reset_sent_at: 2013-03-15 23:00:20
@@ -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.1.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-10 00:00:00.000000000 Z
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/20130310185934_create_users.rb
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/20130310185934_create_users.rb
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