I’m trying to write 2 simple tests for my website. It’s my first time doing this, and I’m running into a bit of an issue
The test specs are super simple: just fill_in the email + password fields, then I click “signup” or “login” based on which I am testing.
I am facing several issues sadly:
-
After the click_on(“…”) call, I have a page.should have_content call. But this never seems to succeed. Selenium closes firefox before I see a successful sign up or login.
-
For login, I’m not sure how to make sure that the test is using my local database. I am on mysql, and I know my DB is running (I can run queries on mysql administrator), but I don’t know if the login is using my DB, and I don’t know if the signup is actually putting a new record in my DB.
Thanks a lot for your help in advance!
Ringo
Rspec will use a different database as development and production.
You can check the name of the database in config/database.yml with the environment ‘test’.
To see the page which is testing, you can call the method
save_and_open_page.It will open a page in your browser and you will be able to know what’s going on.