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.

2 failures in Action Pack in master on 1.9.2-head

#4965

Running the Action Pack test suite on 1.9.2-head gives 1 failure and 1 error:

  1) Failure:
test_uses_the_output_buffer_for_assert_select(ActionView::AssertionsTest) [test/template/test_case_test.rb:229]:
Expected at least 1 element matching "form", found 0.

  2) Error:
test_supports_specifying_locals_(failing)(ActionView::RenderTemplateTest):
NameError: uninitialized constant Test::Unit::AssertionFailedError
    test/template/test_case_test.rb:251:in `block in <class:RenderTemplateTest>'
    /home/rohit/.rvm/gems/ruby-1.9.2-head@bugmash/gems/mocha-0.9.8/lib/mocha/integration/mini_test/version_131_and_above.rb:26:in `run'
    /home/rohit/remote-repos/rails_patches/working4/activesupport/lib/active_support/testing/setup_and_teardown.rb:35:in `block in run'
    /home/rohit/remote-repos/rails_patches/working4/activesupport/lib/active_support/callbacks.rb:428:in `_run_setup_callbacks'
    /home/rohit/remote-repos/rails_patches/working4/activesupport/lib/active_support/testing/setup_and_teardown.rb:34:in `run'

ruby -v
=> ruby 1.9.2dev (2010-06-22 revision 28373) [x86_64-linux]

In first failing test. Replacing the following:

  render(:partial => 'test/from_helper')

with

  puts render(:partial => 'test/from_helper')

gives the following (when running the tests):

1.8.7

<form action="/foo" method="post"><ul><li>foo</li></ul></form>

1.9.2-head

<ul><li>foo</li></ul>

Reported by Rohit Arondekar · June 25th, 2010 @ 04:24 AM

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

Activity

  1. Rohit Arondekar
    Rohit Arondekar
    • Importance changed from to Low

    The first failing test is a strange one. I tried recreating what the test is trying to do in a sample app.

    I created a Post resource and then the following.

    • app/helpers/posts_helper.rb
    module PostsHelper
      def render_from_helper
        form_tag('/foo') do
          safe_concat render(:text => '<ul><li>foo</li></ul>')
        end  
      end
    end
    
    • app/views/posts/index.html.erb
    <%= render :partial => 'test/from_helper' %>
    
    • app/views/test/_from_helper.html.erb
    <%= render_from_helper %>
    
    • OUTPUT of localhost:3000/posts
    ...
    <form action="/foo" method="post"><div style="margin:0;padding:0;display:inline"><input name="authenticity_token" type="hidden" value="/IYCV0CzIdNbd6Z03ZnpN2wbgHwGkB4mtlPtr0j3rpU=" /></div><ul><li>foo</li></ul></form>
    ...
    

    If this is what the test is trying to do then it works perfectly on 1.9.2 (head and preview3). However the render :partial in the test just doesn't render the form(renders the UL list inside it) on 1.9.2. Works fine on 1.8.7.

    I tried following the render :partial call, reached upto actionpack/lib/action_view/render/partials.rb but I couldn't find any difference between the path it took on 1.8.7 and 1.9.2 except that it doesn't render the form on 1.9.2 :(

    June 26th, 2010 @ 12:03 PM

  2. Rohit Arondekar
    Rohit Arondekar

    Note that a patch for the error has been provided in #4987 Action Pack test suite: "uninitialized constant Test::Unit::AssertionFailedEr... and will most likely be applied.

    This leaves the one failing test.

    June 27th, 2010 @ 02:06 AM

  3. Rohit Arondekar
    Rohit Arondekar
    • State changed from new to open

    June 27th, 2010 @ 02:21 AM

  4. Rohit Arondekar
    Rohit Arondekar
    • Assigned user set to José Valim

    Thanks to Jose's help, actionpack tests now pass on 1.9.2 and 1.8.7. Attached is the patch.

    June 28th, 2010 @ 12:14 PM

  5. Repository
    Repository
    • State changed from open to resolved

    June 28th, 2010 @ 12:27 PM