Skip to content

Commit 5d358a4

Browse files
Update chapter03-presenting-users.adoc (#79)
Fix: Use correct password_digest field in test code. Fix: Typo.
1 parent 6ba31a7 commit 5d358a4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

rails6/en/chapter03-presenting-users.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ end
183183
----
184184
# ...
185185
test 'user with invalid email should be invalid' do
186-
user = User.new(email: 'test', password: 'test')
186+
user = User.new(email: 'test', password_digest: 'test')
187187
assert_not user.valid?
188188
end
189189
----
@@ -249,7 +249,7 @@ gem "bcrypt", "~> 3.1"
249249

250250
NOTE: Version 3.1 of bcrypt is the current version at the time of writing. It may therefore vary for your case.
251251

252-
Active Record offers us a method https://github.com/rails/rails/blob/6-0-stable/activemodel/lib/active_model/secure_password.rb#L61[`ActiveModel::SecurePassword::has_secure_password`] that will interface with Bcrypt and hack the password for us very easily.
252+
Active Record offers us a method https://github.com/rails/rails/blob/6-0-stable/activemodel/lib/active_model/secure_password.rb#L61[`ActiveModel::SecurePassword::has_secure_password`] that will interface with Bcrypt and hash the password for us very easily.
253253

254254
[source,ruby]
255255
.app/models/user.rb

0 commit comments

Comments
 (0)