Jeremy
Jeremy

Reputation: 675

Create a devise fixtures user devise a password

I have a rails 5 app running the latest devise and I'd like to create valid users for testing with the fixtures, but I can't update the password as the way devise has users set up there is no passwords column in the users table.

Is there a way to set the fixture up to work around this and have a working user?

text/fixtures/users.yml:

jeremy:
  email: [email protected]
  provider: facebook
  username: Jeremy 

password: password

any test using that user returns:

ActiveRecord::Fixture::FixtureError:         ActiveRecord::Fixture::FixtureError: table "users" has no column named "password".

Upvotes: 0

Views: 654

Answers (1)

Alex Kojin
Alex Kojin

Reputation: 5204

Prepare your test database.

rake db:migrate
rake db:test:prepare

Upvotes: 1

Related Questions