railsware / rack_session_access

Rack middleware that provides access to rack.session environment
MIT License
257 stars 29 forks source link

No routes matches [GET] "/rack_session/edit" #17

Closed C404 closed 9 years ago

C404 commented 9 years ago

Hi,

I just installed your gem with capybara and required "rack_session_access/capybara" in my spec_helper.rb

Yet when i run the test with the following code :

  context "when visitor tracked repositories" do
    it "should see tracked repository list" do
      page.set_rack_session(user_id: 33)
      visit root_path
      ....

I get that error : No routes matches [GET] "/rack_session/edit"

Any idea why ?

Thx !

le0pard commented 9 years ago

Did you add middleware in test env?

C404 commented 9 years ago

Hi, do you mean config.middleware.use RackSessionAccess::Middleware ?

ayanko commented 9 years ago

Yes. You should explitly to inject this middleware into desired environment (test, cucumber). See readme doc.

ayanko commented 9 years ago

I get that error : No routes matches [GET]

@C404 what about to change nick first? :-)

C404 commented 9 years ago

Haha yeah ;) Otherwise you were right ... I think i jumped to fast on the Rspec part forgetting that line in the test env. Thx !