This project is archived and is in readonly mode.

#3111 ✓stale
Jarl Friis

[PATCH] ActionController::Integration::Session#get does not set HTTP_REFERER

Reported by Jarl Friis | August 28th, 2009 @ 09:09 AM

Rails version: 2.3.3

In an integration test, where sequential calls to get/put/post should emulate a users behaviuor in a browser, I expect that sequntial calls would set HTTP_REFERER header to the value of the last request performed.

Currently I have to do this manually, by

get orders_path, nil, { "HTTP_REFERER" => @request.url }

for every call to get/put/post that is not the first one.

Jarl

Comments and changes to this ticket

  • CancelProfileIsBroken

    CancelProfileIsBroken September 25th, 2009 @ 12:39 PM

    • Tag changed from headers, integration_test, session to bugmash, headers, integration_test, session
  • Elomar França

    Elomar França September 26th, 2009 @ 01:47 PM

    • Tag changed from bugmash, headers, integration_test, session to bugmash, headers, integration_test, patch, session
    • Title changed from “ActionController::Integration::Session#get does not set HTTP_REFERER” to “[PATCH] ActionController::Integration::Session#get does not set HTTP_REFERER”
    1. IMO, this is the right way to simulate the user behavior.

    I've attached a tiny little patch.

  • Elomar França

    Elomar França September 26th, 2009 @ 01:58 PM

    Forgot to mention, patch applies only on 2-3-stable. I could not get it working on master yet.

  • David Trasbo

    David Trasbo September 26th, 2009 @ 05:54 PM

    +1

    I definitely also think Rails should try to simulate browser behaviour in integration tests.

    verified

    The patch applies cleanly to 2-3-stable and the test is passing.

  • sr.iniv.t

    sr.iniv.t September 27th, 2009 @ 07:41 PM

    +1 verified. +1 for the idea too.

    Patch applies cleanly on 2-3-stable and all tests pass.

  • Elomar França

    Elomar França September 27th, 2009 @ 10:06 PM

    I've attached a patch that applies on master.

  • Gaius Centus Novus

    Gaius Centus Novus September 27th, 2009 @ 11:18 PM

    +1 & verified for the 2-3-stable patch

  • Jarl Friis

    Jarl Friis September 28th, 2009 @ 10:37 AM

    Even though the tittle only mentions the get method, the problem should also be fixed on put and post methods, I haven't investigated the patch to see if it also fixes the problem for those methods. Elomar, can you tell?

    Jarl

  • Elomar França

    Elomar França September 28th, 2009 @ 11:45 AM

    Jarl,

    Yes, it fixes this problem for any method.

  • Rizwan Reza

    Rizwan Reza February 12th, 2010 @ 12:46 PM

    • Tag changed from bugmash, headers, integration_test, patch, session to headers, integration_test, patch, session
  • Santiago Pastorino

    Santiago Pastorino February 2nd, 2011 @ 04:44 PM

    • State changed from “new” to “open”
    • Importance changed from “” to “”

    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

    Santiago Pastorino February 2nd, 2011 @ 04:44 PM

    • State changed from “open” to “stale”

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Pages