I have finished Chapter 6 of railstutorial but all my User model specs have started failing soon after I added password & password_confirmation
It is producing these errors because the very first before {} block is trying to add two attributes that the User model doesn't specify - password and password_confirmation.
Because this before {} block is run before every test (that's the point), you are getting an error on every test and they're all failing. It's not that the test is failing, per se, but rather ActiveRecord doesn't know what to do with those attributes and is producing an error before each test is really even run:
ActiveRecord::UnknownAttributeError:
unknown attribute: password
As codeneko's answer says, this is fixed by simply moving forward in the tutorial and putting has_secure_password in the User model file. This tells ActiveRecord to accept password and password confirmation attributes and all the tests will pass.
Unfortunately the tutorial promptly tells you to comment out has_secure_password so using diving's answer as a stand-in is probably not a bad idea until the tutorial has you uncomment that.