Derek
Derek

Reputation: 8630

Rails 5 Upgrade- request.fullpath not returning the same value as Rails 4 for Controller Tests

I've recently upgraded my app to Rails 5.2 from Rails 4.2 and I'm seeing some fallout in my in my contrioller tests.

In the Rails 4 engine, the value of the request.fullpath in my test case returns as:

'/myapp/foo/new'

But the same controller tests fail in the Rails 5 engine, whereby request.fullpath is now:

'/foo/new'

I don't know if I'm missing some configuration after the upgrade. I can see that when setting this let variable, its getting the correct path:

let(:return_to) { MyApp::Engine.routes.url_helpers.new_foo_path }

So far, my only workaround in the tests is to do add the following to teh request before the tests run.

 request.env["SCRIPT_NAME"] = "/myapp"

what am i missing?

Upvotes: 0

Views: 8

Answers (0)

Related Questions