I am trying to perform an integration test through Watir and RSpec . So, I created a test file inside / integration and wrote a test that adds a test user to the database through factory_girl .
The problem is that I cannot login with my test user. The test I wrote is as follows:
...
before(:each)
@user = Factory(:user)
@browser = FireWatir::Firefox.new
end
it "should login"
@browser.text_field(:id, "username").set(@user.username)
@browser.text_field(:id, "password").set(@user.password)
@browser.button(:id, "get_in").click
end
...
When I run a test and see "performance" in the browser, it always launches an error Username is not valid.
I started an investigation and did a little trick. First of all, I had doubts if the factory actually creates the user in the database. So after an immediate factory call, I added stuff puts User.findjust to find that the user . , , , .
sleep factory , . , , ! ? , , - . , , factory_girl ? test dev DB? .
10 , Mongrel test ( ? , , ), database.yml .
authlogic, (no, put activate_authlogic ).