plataformatec/devise — Issue #1559: How do I explicitly set the user in user session when testing with Capybara?
Author: d3chapma
Created: 2012-01-10 20:08:20+00:00
State: open

I am trying to write some integration tests with rspec and capybara. I would like to write a test like this:

```ruby
@user = Factory :user
sign_in @user

visit articles_path
click_on "new_article"
fill_in "Title", :with => "Dummy Article"
fill_in "Content", :with => "Dummy content"
click_on "Create"
current_path.should == articles_path
```

Unfortunately in the docs it says not to use the sign_in method in integration tests. How do I then explicitly set the user as signed in?