This project is archived and is in readonly mode.

#4965 ✓resolved
Rohit Arondekar

2 failures in Action Pack in master on 1.9.2-head

Reported by Rohit Arondekar | June 25th, 2010 @ 04:24 AM | in 3.x

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>

Comments and changes to this ticket

  • Rohit Arondekar

    Rohit Arondekar June 26th, 2010 @ 12:03 PM

    • 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 :(

  • Rohit Arondekar

    Rohit Arondekar June 27th, 2010 @ 02:06 AM

    Note that a patch for the error has been provided in #4987 and will most likely be applied.

    This leaves the one failing test.

  • Rohit Arondekar

    Rohit Arondekar June 27th, 2010 @ 02:21 AM

    • State changed from “new” to “open”
  • Rohit Arondekar

    Rohit Arondekar June 28th, 2010 @ 12:14 PM

    • 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.

  • Repository

    Repository June 28th, 2010 @ 12:27 PM

    • State changed from “open” to “resolved”

    (from [ccb21f20d86ffc17c10cb5e476912157c739dd96]) Convert instance_variables to symbols before excluding internal vars [#4965 state:resolved]

    Signed-off-by: José Valim jose.valim@gmail.com
    http://github.com/rails/rails/commit/ccb21f20d86ffc17c10cb5e4769121...

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>

Attachments

Referenced by

Pages