You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The only tweaking was to change the directory structure (using cijoe/app/repos for the actual projects instead of cijoe-repos and cijoe/public for root instead of cijoe)
The setup works great, the environment is properly configured and the git hooks properly fire.
Here is problem rspec code
response.shouldredirect_to(:action=>:index)
When run from the command line using the same cijoe.runner command, it works fine. When run inside Cijoe, the paths do not properly resolve resulting in a precondition-like expection
Here is the failing stack trace (not overly useful)
I dug deeper and determined which line in rspec's RedirectTo class is causing the exception.
Rspec is failing on the "actual" path around line 32 (shown below)
if@expected.instance_of?Hashreturnfalseunless@actual =~ %r{^\w+://#{@request.host}}returnfalseunlessactual_redirect_to_valid_route# this method is failingreturnactual_hash == expected_hash && @status_matchedelse
If you inspect the response, you see that the REQUEST_URI is invalidly set to
/myproject/admin/index
The "myproject" is not valid and it should just be /admin/index. When run within Cijoe, the URI is prepending the name of the project (i.e. myproject), which is not a valid path resulting in that internal exception shown above. When run on the same machine, from the same environment on the command line, the "myproject" is not added to the URI and the test passes.
Things I have tried already
An internet search. Unfortunately most of the hits were about the incorrect use of redirect_to, or the hard-coding of @request.host
Running the "rake ci:build" on the command line, and yes it works
Inspecting "RAILS_ROOT" and it properly points to myproject/app
Trial and error inspecting several objects to see where / how "myproject" is being added to URL
What I am looking for
Direction, if possible on how best to resolve this issue. Is Cijoe setting something up that Rspec doesn't expect, is Rack doing something special, is Rspec not handling this subdirectory case properly
I would prefer to not change my test (at least not that much), so any insight would be greatly appreciated.
The text was updated successfully, but these errors were encountered:
First thought is to figure out how to turn on "skip_relative_url_root" from within the specs, or better yet figure out why relative_url_root is set to one directory higher.
Not sure if this is a bug in our code, in the RedirectTo rspec matcher, or cijoe itself.
Here is the setup
Multiple Cijoe's + Rack + Nginx similar to the described at
The only tweaking was to change the directory structure (using cijoe/app/repos for the actual projects instead of cijoe-repos and cijoe/public for root instead of cijoe)
The setup works great, the environment is properly configured and the git hooks properly fire.
Here is problem rspec code
When run from the command line using the same cijoe.runner command, it works fine. When run inside Cijoe, the paths do not properly resolve resulting in a precondition-like expection
Here is the failing stack trace (not overly useful)
I dug deeper and determined which line in rspec's RedirectTo class is causing the exception.
Rspec is failing on the "actual" path around line 32 (shown below)
If you inspect the response, you see that the REQUEST_URI is invalidly set to
The "myproject" is not valid and it should just be /admin/index. When run within Cijoe, the URI is prepending the name of the project (i.e. myproject), which is not a valid path resulting in that internal exception shown above. When run on the same machine, from the same environment on the command line, the "myproject" is not added to the URI and the test passes.
Things I have tried already
What I am looking for
Direction, if possible on how best to resolve this issue. Is Cijoe setting something up that Rspec doesn't expect, is Rack doing something special, is Rspec not handling this subdirectory case properly
I would prefer to not change my test (at least not that much), so any insight would be greatly appreciated.
The text was updated successfully, but these errors were encountered: