jeudi 24 décembre 2015

Testing in Rails. Seems it deletes records within one test run. Ideas?

Let's take a look at the next scenario: Scenario: Show welcome feed Given log me in When I'm on "profile" page Then Page should have content "You are welcome"

Pretty simple. What about log me in step? Given /^log me in$/ do @user = FactoryGirl.create :user, email: 'user@mail.ru', password: '12345678', username: ' visit sign_in_path fill_in 'user_email', with: 'user@mail.ru' fill_in 'user_password', with: '12345678' click_on 'Enter' end Nothing complex. But when I run this scenario it can't log me in because there is no user with provided email. Lol what? It happens with other scenarios where I trying to create and log in user.

  • It works before, there weren't any changes in scenarios.
  • It works in development and production environment. So it's environment issue I guess.

Any ideas? How to debug this?

Aucun commentaire:

Enregistrer un commentaire