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.

integration test fails on complex forms updating multiple models

#2576

Hi.

The problem is described on http://groups.google.com/group/r...

I figured out that it was a problem in the Mock request generated by the rails framework.

I have made a patch.

The patch include tests that demonstrates the problem plus code that fixes the problem.

Reported by Jarl Friis · April 28th, 2009 @ 03:12 PM

State: stale
Milestone: 3.x
Assigned to: José Valim José Valim
Importance: Low

Activity

  1. Jarl Friis
    Jarl Friis

    Oh, there was some outcommented debug code in my diff, here is a more clean diff

    Sorry.

    April 28th, 2009 @ 03:16 PM

  2. Jarl Friis
    Jarl Friis
    • Tag changed from forms, integration_test, multipart to forms, integration_test, multipart, params, patch, patched

    April 29th, 2009 @ 07:54 AM

  3. Jarl Friis
    Jarl Friis
    • Tag changed from forms, integration_test, multipart, params, patch, patched to fields_for, fix, forms, integration_test, multipart, params, patch, patched

    April 29th, 2009 @ 07:55 AM

  4. Jarl Friis
    Jarl Friis

    I have now made a patch according to "Contributing to Rails" article https://rails.lighthouseapp.com/...

    Here it is.

    April 29th, 2009 @ 08:16 AM

  5. josh
    josh
    • Assigned user set to josh

    April 29th, 2009 @ 01:37 PM

  6. josh
    josh
    • State changed from new to resolved

    This should be fixed in edge. If its still not working for you, please create a ticket on the rack lighthouse.

    May 5th, 2009 @ 02:14 AM

  7. Jarl Friis
    Jarl Friis

    Seems like current edge requires newer rubygems than I have on my Intrepid. I'll take a look at it when I upgrade my dev-box to Jaunty. I can at least see that edge does no longer contain the failing code, it has probably moved to the rack project.

    However, looking at rack edge source code, it seems that Utils::Multipart.build_multipart in rack/lib/rack/utils.rb contains the essential fix.

    May 5th, 2009 @ 10:40 AM

  8. Jarl Friis
    Jarl Friis

    In case someone is interested in a patch for Rails 2.3.3, here it is.

    Jarl

    September 7th, 2009 @ 11:04 AM

  9. Jarl Friis
    Jarl Friis

    I wonder why no one applies this patch to the 2.3.x branch.

    I have to do this manually every time I upgrade rails (now to 2.3.4)

    This is unpractical.

    Jarl

    September 16th, 2009 @ 08:32 AM

  10. Jarl Friis
    Jarl Friis

    Joshua, I doubt that this is fixed in Edge (as of May 2009). SInce the problem still exists in 2.3.5. Could you please have a look at it again. Otherwise please guide as to how I should show a failing unit test in edge.
    In what file shoud I add a test? Or in what directory should I add a file?
    then what (rake) command should I run to see test results.

    I here attach a patch for 2.3.5

    Jarl

    January 18th, 2010 @ 01:46 PM

  11. Jarl Friis
    Jarl Friis

    I have now made a patch (according to contributor guide: https://rails.lighthouseapp.com/projects/8994/sending-patches). The patch is against the 2-3-stable branch.

    The patch includes two unit tests that demonstrates the problem plus the fix of course.

    Please apply this patch against 2.3 branch, will you?

    Jarl

    January 18th, 2010 @ 06:58 PM

  12. Jon Yurek
    Jon Yurek

    The above patch did not work for us. I've modified it a bit and it causes the app tests that were previously failing to pass. This patch is based on Jarl's. It applies cleanly to 2-3-stable.

    June 4th, 2010 @ 09:46 PM

  13. Jarl Friis
    Jarl Friis

    Good to see there is some interest in this ticket.

    Just of curiousity: Which "above patch" did not work? I have supplied several patches to this ticket. You say that your patch is based on mine (but not which one), and at the same time "the above patch did not work" while all of my patches are above your comment :-)

    Another question: which branch is you patch against?

    Note further that this ticket is marked "resolved" because Joshua believes this is fixed in edge. However it has not been verified by anyone yet, and even if it was solved I would love to see tests (in edge) that ensured not introducing the bug again.

    Jarl

    June 7th, 2010 @ 11:05 AM

  14. José Valim
    José Valim
    • Milestone changed from 2.x to 2.3.9
    • State changed from resolved to open
    • Assigned user changed from josh to José Valim
    • Importance changed from to Low

    Great work guys. I will apply this on 2-3-stable. Can someone provide a test case for master (in any case, I saw this issue being fixed in rack-test)? Thanks!

    July 17th, 2010 @ 07:26 PM

  15. Nick Quaranto
    Nick Quaranto

    José, Yehuda just applied it to 2-3-stable. It's fixed in master as far as I know because rack's multipart params parsing is a lot smarter. A test case for it would be a really good idea though.

    July 17th, 2010 @ 07:28 PM

  16. José Valim
    José Valim
    • Milestone cleared.
    • Tag changed from fields_for, fix, forms, integration_test, multipart, params, patch, patched to bugmash, fields_for, fix, forms, integration_test, multipart, params, patch, patched

    July 21st, 2010 @ 02:34 PM

  17. José Valim
  18. Jarl Friis
    Jarl Friis

    Actually the patch provided April 29th, 2009 @ 08:16 AM (https://rails.lighthouseapp.com/projects/8994/tickets/2576/a/116520...) contains a test. However the following diffs I have submitted is without this test.

    The test probably needs to be updated to the latest 2-3-stable branch.

    Why is this changed from 2.3.9 to 3.x?

    Jarl

    August 3rd, 2010 @ 11:26 AM

  19. José Valim
    José Valim

    Jarl, it was applied on 2.3.9. We just need a test to be added to Rails 3.0 to ensure we won't have regressions.

    August 3rd, 2010 @ 11:38 AM

  20. Jarl Friis
    Jarl Friis

    @José: Thanks for the information, looking forward to 2.3.9. Still I hope you can use the test in the patch to make a test in 3.x, but it sounds like the architecture changes requires a new test to be written.

    August 3rd, 2010 @ 11:49 AM

  21. José Valim
    José Valim
    • State changed from open to stale

    September 2nd, 2010 @ 10:58 AM

  22. Jarl Friis
    Jarl Friis

    Why is state changed to stale? and what does it mean?

    September 2nd, 2010 @ 12:05 PM

  23. José Valim
    José Valim

    I'm marking it as stale as I didn't get a patch back. I will gladly reopen it if one is provided.

    September 2nd, 2010 @ 12:12 PM

  24. Andrea Campi
    Andrea Campi
    • Tag changed from bugmash, fields_for, fix, forms, integration_test, multipart, params, patch, patched to bugmash, fields_for, fix, forms, integration_test, multipart, params, patch

    bulk tags cleanup

    October 11th, 2010 @ 07:24 AM

  25. Jarl Friis
    Jarl Friis

    I have tested this in 2.3.9, and it seems fixed there.

    I consider this bug as resolved, fix released.

    November 8th, 2010 @ 08:12 AM

  26. Jeff Kreeftmeijer
    Jeff Kreeftmeijer
    • Tag cleared.

    Automatic cleanup of spam.

    November 8th, 2010 @ 08:26 AM