Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Devise feature tests not redirecting to sign_in page

Status
Not open for further replies.

c73mr0ck

Programmer
Oct 25, 2012
11
US
I've noticed some strange behavior ONLY in feature tests when a user is not logged in and they aren't being redirected to the sign in page and I'm trying to understand why. I’m using poltergeist as the javascript driver.

Here's a couple of examples:
Ruby:
    # works as expected
    it 'redirects to sign_in page when not logged in' do
      get :index, {}
      expect(response).to redirect_to('/users/sign_in')
    end

    # does not redirect to '/users/sign_in'
    it 'should redirect to the user sign in page' do
      visit '/'
      expect(page.current_path).to eq('/users/sign_in')
    end

Does anyone know why devise isn’t redirecting to the sign_in page in feature tests?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top