#41 ✓ resolved
James Adam

View tests shouldn't rely on `first_render`

Reported by James Adam | October 30th, 2008 @ 07:56 AM

The first_render attribute is gone from ActionView::Base in edge rails, so the tests should stop relying on it.

Comments and changes to this ticket

  • theinterned

    theinterned November 7th, 2008 @ 11:37 AM

    Hi, I tried globally changing the <%= self.first_render %> to <%= self.instance_variable_get(:@_first_render) %>

    this seems to work pushing the errors to failures:

    <"namespace/app_and_plugin/a_view (from app)"> expected but was <"namespace/app_and_plugin/a_view.html.erb (from app)">

    etc.

    This seems acceptable if the test condition was just changed from assert_response_body 'alpha_plugin/a_view' to assert_response_body 'alpha_plugin/a_view.html.erb'

    would that still satisfy the test? are the file extensions a problem?

  • James Adam

    James Adam November 9th, 2008 @ 05:26 AM

    • State changed from “new” to “open”

    Technically that's fine - I'll update the tests. However, it would be nicer not to have to relying on poking into the internals of ActionView to check this.

  • James Adam

    James Adam November 9th, 2008 @ 05:51 AM

    • State changed from “open” to “resolved”

    (from [d962f927e42324d5c4e2c2d08d2365cd5ead957c]) We shouldn't rely on first_render to determine which template was being rendered [#41 state:resolved] http://github.com/lazyatom/engin...

  • James Adam

    James Adam November 11th, 2008 @ 12:45 PM

    (from [23db4298f689c2854c8c6f0d0cf42764dabee5b5]) We shouldn't rely on first_render to determine which template was being rendered [#41 state:resolved] http://github.com/lazyatom/engin...

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

The rails engines plugin itself

Shared Ticket Bins

People watching this ticket

Referenced by

Pages