This project is archived and is in readonly mode.

#2096 ✓stale
James B. Byrne

Added select method tests to form_helper_test.rb

Reported by James B. Byrne | February 27th, 2009 @ 09:56 PM | in 3.x

Tests for select helper method.

Comments and changes to this ticket

  • James B. Byrne

    James B. Byrne February 28th, 2009 @ 12:53 AM

    Added a git patch-format diff. jbb-2096-form-helper-test-select.diff

  • Jaime Bellmyer

    Jaime Bellmyer February 28th, 2009 @ 02:02 AM

    I think the patch needs to be updated with an e-mail address. I received this message when I tried to apply it per lighthouse instructions:

    
    rails>git am < ../../form_helper_test_select.diff
    Patch does not have a valid e-mail address.
    

    I was able to read the diff file, however, and I did notice one change that needs to be made. The select methods called in the test are passing hashes of options. The order of a hash is not guaranteed, therefore you're not guaranteed that the expected string will match. This test could very well fail on other systems for this reason. Passing in a two dimensional array will guarantee that these test run and pass predictably, like so:

    
      assert_dom_equal(expected, select(:post, :title, 
        [ ['OPTion Two','OPT2'], ['OPTion One','OPT1'] ]
    

    Once these things are fixed, I think this will be a very useful patch.

  • James B. Byrne

    James B. Byrne February 28th, 2009 @ 02:30 AM

    • Tag changed from actionview, tests to actionview, patch, tests

    Thanks. I will make the recommended changes and resubmit. Sorry about the email address. I switched hosts and did not have my laptop fully configured for git.

  • James B. Byrne
  • James B. Byrne
  • James B. Byrne
  • Jaime Bellmyer

    Jaime Bellmyer February 28th, 2009 @ 05:28 PM

    this looks great! +1 from me. The tests make sense for shoring up rails, and they pass.

  • Jeremy Kemper

    Jeremy Kemper May 4th, 2010 @ 06:48 PM

    • Milestone changed from 2.x to 3.x
  • Santiago Pastorino

    Santiago Pastorino February 2nd, 2011 @ 04:54 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:54 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