Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Added select method tests to form_helper_test.rb

#2096

Tests for select helper method.

Reported by James B. Byrne · February 27th, 2009 @ 09:56 PM

State: stale
Milestone: 3.x
Assigned to: nobody
Importance: none

Activity

  1. James B. Byrne
    James B. Byrne

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

    February 28th, 2009 @ 12:53 AM

  2. Jaime Bellmyer
    Jaime Bellmyer

    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.

    February 28th, 2009 @ 02:02 AM

  3. James B. Byrne
    James B. Byrne
    • 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.

    February 28th, 2009 @ 02:30 AM

  4. James B. Byrne
  5. James B. Byrne
  6. James B. Byrne
  7. Jaime Bellmyer
    Jaime Bellmyer

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

    February 28th, 2009 @ 05:28 PM

  8. Jeremy Kemper
    Jeremy Kemper
    • Milestone changed from 2.x to 3.x

    May 4th, 2010 @ 06:48 PM

  9. Santiago Pastorino
    Santiago Pastorino
    • 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.

    February 2nd, 2011 @ 04:54 PM

  10. Santiago Pastorino
    Santiago Pastorino
    • State changed from open to stale

    February 2nd, 2011 @ 04:54 PM