How would I write a test in rspec to ensure passwords are not stored as plain text in my Ruby on Rails application?
I don't really care about the implementation yet as I don't know exactly what plugin or how I am going to write the password encryption (there are lots of examples).
I just want a failing test that's independent of the implementation. Then, when I implement my code I can be confident I don't have plain text passwords.
I'm thinking I need to save the user (with password) and then fetch the user again and check the password does not equal the plain text version somehow.
Am I even on the right track?
I have these empty tests:
describe "password encryption" do
it "should have an encrypted password attribute"
it "should set the encrypted password"
it "should encrypt the password"
end