This project is archived and is in readonly mode.
request_uri in tests include posted parameters
-
Zyclops
I'm getting the exact same issue.
post :save_security_profile, { 'advanced_projects_and_fellowships_access' => [125,126], 'roles' => 1 }
puts request.request_uri => /admin/save_security_profile?advanced_projects_and_fellowships_access%5B%5D=125&advanced_projects_and_fellowships_access%5B%5D=126&roles=1
Another person with this issue last year http://www.ruby-forum.com/topic/...
-
David Trasbo
- State changed from new to incomplete
- Importance changed from to
As for edge Rails, I've been digging around in the source, and it seems
request_uri(orREQUEST_URI) is gone altogether, except arequest_uri=method inActionDispatch::TestRequest, but the header is not set by default and there's no convenience method for accessing it.The issue still exists on
2-3-stablethough:$ script/generate controller people index exists app/controllers/ exists app/helpers/ create app/views/people exists test/functional/ create test/unit/helpers/ create app/controllers/people_controller.rb create test/functional/people_controller_test.rb create app/helpers/people_helper.rb create test/unit/helpers/people_helper_test.rb create app/views/people/index.html.erbconfig/routes.rb:ActionController::Routing::Routes.draw do |map| map.resources :people endtest/functional/people_controller_test.rb:require 'test_helper' class PeopleControllerTest < ActionController::TestCase test "request_uri does not include GET params when SSL is on" do @request.env['HTTPS'] = 'on' get :index, :foo => 'bar' assert_equal '/people', @request.request_uri end endrake test:functionalsoutputs the following:(in /Users/dtrasbo/Documents/Code/ticket_2552) /Users/dtrasbo/.rvm/rubies/ruby-1.9.2-p0/bin/ruby -I"lib:test" "/Users/dtrasbo/.rvm/gems/ruby-1.9.2-p0@global/gems/rake-0.8.7/lib/rake/rake_test_loader.rb" "test/functional/people_controller_test.rb" Loaded suite /Users/dtrasbo/.rvm/gems/ruby-1.9.2-p0@global/gems/rake-0.8.7/lib/rake/rake_test_loader Started F Finished in 0.085008 seconds. 1) Failure: test_request_uri_does_not_include_GET_params_when_SSL_is_on(PeopleControllerTest) [test/functional/people_controller_test.rb:7]: <"/people"> expected but was <"/people?foo=bar">. 1 tests, 1 assertions, 1 failures, 0 errors, 0 skips Test run options: --seed 62202 rake aborted! Command failed with status (1): [/Users/dtrasbo/.rvm/rubies/ruby-1.9.2-p0/b...] (See full trace by running task with --trace)Please provide a patch (https://rails.lighthouseapp.com/projects/8994/sending-patches) with a fix and/or a failing test.
-
Jeff Kreeftmeijer
Automatic cleanup of spam.
-
Santiago Pastorino
- State changed from incomplete to open
This issue has been automatically marked as stale because it has not been commented on for at least three months.
The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.
Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.
-
Santiago Pastorino
- State changed from open to stale