Ive setup capybara-webkit for my integration tests, and Im working in a very simple problem. My session is not saved. Use case is quite simple
1. Login 2. Go to a specific page 3. Check if it has the approp content
Now in step 2, my application returns a test case to the login page - this means that the session is not configured properly.
any help is much appreciated
If I use @culerity instead of @javascript then this test case passes, so the problem is setting capybara-webkit
My env.rb to support capybara-webkit is as follows
Spork.prefork do require 'cucumber/rails' require 'capybara' require 'capybara/dsl' require 'capybara/cucumber' require 'capybara-webkit' Capybara.run_server = false Capybara.javascript_driver = :webkit Capybara.default_selector = :css
Update 1: It seems that the sessions are being established. I used the following code to reset the session in my steps.
puts(Capybara.current_session.driver.browser.get_cookies)
and I got the following: it looks like a cookie is being set but not sent back
[ "_ Jqt_session = BAh7CEkiD3Nlc3Npb25faWQGOgZFRiIlYmMwYzNjYjY0MGU3NTg0OWFlNTcwODhmM2I2MzE1YmRJIhBfY3NyZl90b2tlbgY7AEZJIjEwRzN6NG1NTzZqamNCNC9FdWZWeXBCMHdoeThueXBnaTJDcTVzbmJqQlBZPQY7AEZJIgpmbGFzaAY7AEZJQzolQWN0aW9uRGlzcGF0Y2g6OkZsYXNoOjpGbGFzaEhhc2h7BjoKYWxlcnRJIh9JbnZhbGlkIGVtYWlsIG9yIHBhc3N3b3JkLgY7AFQGOgpAdXNlZG86CFNldAY6CkBoYXNoewY7B1Q% 3D - 3fbe1c2a77a433228e7b7f2d8c8f0aec3ad5fb5f; HttpOnly; domain = localhost; path = /"]
Update 2: barking the wrong tree. It seems that the user I created in my test case did not see the rails application, since my database cleanup strategy was set to transaction. see more information at https://groups.google.com/forum/#!msg/ruby-capybara/JI6JrirL9gM/R6YiXj4gi_UJ
source share