I finished chapter 6 of the tutorial , but all of my user model specifications started to crash shortly after adding passwordand password_confirmationwith the following errors:
Failures:
1) User
Failure/Error: @user = User.new(name: "Example User", email: "user@example.com",
ActiveRecord::UnknownAttributeError:
unknown attribute: password
2) User
Failure/Error: @user = User.new(name: "Example User", email: "user@example.com",
ActiveRecord::UnknownAttributeError:
unknown attribute: password
3) User
Failure/Error: @user = User.new(name: "Example User", email: "user@example.com",
ActiveRecord::UnknownAttributeError:
unknown attribute: password
4) User
Failure/Error: @user = User.new(name: "Example User", email: "user@example.com",
ActiveRecord::UnknownAttributeError:
unknown attribute: password
5) User
Failure/Error: @user = User.new(name: "Example User", email: "user@example.com",
ActiveRecord::UnknownAttributeError:
unknown attribute: password
6) User
Failure/Error: @user = User.new(name: "Example User", email: "user@example.com",
ActiveRecord::UnknownAttributeError:
unknown attribute: password
7) User
Failure/Error: @user = User.new(name: "Example User", email: "user@example.com",
ActiveRecord::UnknownAttributeError:
unknown attribute: password
8) User when name is not present
Failure/Error: @user = User.new(name: "Example User", email: "user@example.com",
ActiveRecord::UnknownAttributeError:
unknown attribute: password
9) User when email is not present
Failure/Error: @user = User.new(name: "Example User", email: "user@example.com",
ActiveRecord::UnknownAttributeError:
unknown attribute: password
10) User when name is too long
Failure/Error: @user = User.new(name: "Example User", email: "user@example.com",
ActiveRecord::UnknownAttributeError:
unknown attribute: password
11) User when email format is invalid should be invalid
Failure/Error: @user = User.new(name: "Example User", email: "user@example.com",
ActiveRecord::UnknownAttributeError:
unknown attribute: password
12) User when email format is valid should be valid
Failure/Error: @user = User.new(name: "Example User", email: "user@example.com",
ActiveRecord::UnknownAttributeError:
unknown attribute: password
13) User when email address is already taken
Failure/Error: @user = User.new(name: "Example User", email: "user@example.com",
ActiveRecord::UnknownAttributeError:
unknown attribute: password
14) User when password is not present
Failure/Error: @user = User.new(name: "Example User", email: "user@example.com",
ActiveRecord::UnknownAttributeError:
unknown attribute: password
15) User when password confirmation is nil
Failure/Error: @user = User.new(name: "Example User", email: "user@example.com",
ActiveRecord::UnknownAttributeError:
unknown attribute: password
16) User when password doesn't match confirmation
Failure/Error: @user = User.new(name: "Example User", email: "user@example.com",
ActiveRecord::UnknownAttributeError:
unknown attribute: password
# ./spec/models/user_spec.rb:17:in `new'
17) User return value of authenticate method with valid password
Failure/Error: @user = User.new(name: "Example User", email: "user@example.com",
ActiveRecord::UnknownAttributeError:
unknown attribute: password
18) User return value of authenticate method with invalid password
Failure/Error: @user = User.new(name: "Example User", email: "user@example.com",
ActiveRecord::UnknownAttributeError:
unknown attribute: password
19) User return value of authenticate method with invalid password
Failure/Error: @user = User.new(name: "Example User", email: "user@example.com",
ActiveRecord::UnknownAttributeError:
unknown attribute: password
20) User with a password that too short
Failure/Error: @user = User.new(name: "Example User", email: "user@example.com",
ActiveRecord::UnknownAttributeError:
unknown attribute: password
Finished in 7.43 seconds
39 examples, 20 failures, 5 pending
Failed examples:
rspec ./spec/models/user_spec.rb:22
rspec ./spec/models/user_spec.rb:23
rspec ./spec/models/user_spec.rb:24
rspec ./spec/models/user_spec.rb:25
rspec ./spec/models/user_spec.rb:26
rspec ./spec/models/user_spec.rb:27
rspec ./spec/models/user_spec.rb:28
rspec ./spec/models/user_spec.rb:32
rspec ./spec/models/user_spec.rb:37
rspec ./spec/models/user_spec.rb:42
rspec ./spec/models/user_spec.rb:46
rspec ./spec/models/user_spec.rb:57
rspec ./spec/models/user_spec.rb:73
rspec ./spec/models/user_spec.rb:78
rspec ./spec/models/user_spec.rb:83
rspec ./spec/models/user_spec.rb:88
rspec ./spec/models/user_spec.rb:96
rspec ./spec/models/user_spec.rb:102
rspec ./spec/models/user_spec.rb:103
rspec ./spec/models/user_spec.rb:109
rake aborted!
The user model can be found here. Now I have already compared the source code with the original, but it seems that I'm missing something. Not that there is
Can someone tell me why this error is occurring?