Closed mirkode closed 7 years ago
That's weird. Where do you see this error about unknown routing? Which framework do you use? Rails? Which version?
You may add middleware temporary to config/environments/development.rb and check if page /rack_session/edit loads.
If it works for dev env but does not work for test then I guess you have some specific configuration.
Hey @ayanko,
thanks for getting back to me so quickly.
I am using Rails 5.1.2 and it indeed works when I add the middleware to the development.rb
, so it might be something different with my test env.
That is really weird as I don't have a lot of configuring going on. I will update once I have found an answer.
Thanks again!
Let me know when you detect the issue. I want to have this integration simple and easy. Actually people don't have issues with this gem. But probably I need to improve documentation in someway...
Hey @ayanko,
so it was indeed my environment.
The environment I would let my tests run in was explicitly set to "development".
I figured it out after I added the middleware to the development.rb
and let the specs run.
The gem itself was in the group :development, :test do
.
Digging into the auto-generated rails_helper.rb
I saw that it would use this line:
ENV['RAILS_ENV'] ||= 'test'
In my case I simply changed it to
ENV['RAILS_ENV'] = 'test'
to explicitly set my environment to test.
Even though it has nothing to do with the gem, I am adding this insight in case someone else is stumbling upon this issue as well.
Thanks a lot for your help and sorry about the fuzz!
Happy using this cool gem 😉
Hey folks,
so to begin with, I investigated this issue and I do have
in my
/environments/test.rb
, so this (being the only cause of this error I could find on-line) should not be the problem.rake RAILS_ENV=test middleware
spits out:I have a simple login helper which sets the rack session as such:
page.set_rack_session('warden.user.user.key' => User.serialize_into_session(user))
I pry'ed in and checked and the user is set. But still this didn't work and I always get the Capybara error:So I followed down this rabbit hole and the method where this error occurred is visiting the
::RackSessionAccess.edit_path
(rack_session_access-0.1.1/lib/rack_session_access/capybara.rb
). There it stops throwing the error mentioned above (No route matches [GET] "/rack_session/edit"
). After consulting Google up and down I could not come up with any other solution then to finally address the issue here.Can one of you guys help me please?