As part of my integration tests for the website, I use a capybara cucumber. It seems that capybara cannot emulate the use of cookies.
For example, I set a cookie when a user signs:
def sign_in(user)
cookies.permanent.signed[:remember_token] = [user.id, user.salt]
current_user = user
end
However, when I later get the cookie value using cookie.inspect, it returns {} Is this capybara limitation known? How can I test a subscribed user on multiple requests, if so?
I have to add my test:
Scenario: User is signed in when they press Sign In
Given I have an existing account with email "bob@jones.com" and password "123456"
And I am on the signin page
When I fill in "Email" with "bob@jones.com"
And I fill in "Password" with "123456"
And I press "Sign In"
Then I should see "Welcome Bob Jones"
source
share