Created
July 14, 2009 14:14
-
-
Save cyberkni/146963 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<%= render partial='header' %> | |
<body> | |
<%= render partial='nav' %> | |
Other stuff | |
<%= yield %> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%- inside_layout 'base' do -%> | |
Section Titles | |
Other Stuff | |
<%= yield %> | |
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Placeholder new page. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SampleController < ApplicationController | |
layout :local | |
def new | |
# some setup code here but its not relevant to the view issues I'm having | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def test_new_renders_new_template | |
get :new | |
assert_template 'new' | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This setup worked on Rails 2.1.2. I just upgraded to Rails 2.3.2 and this issue started occurring. My site does use the nested_layouts plugin which can be found here: http://github.com/amatsuda/nested_layouts/tree/master | |
That plugin implements that inside_layout method I call inside my local layout. | |
This the test snippet I provided fails like this: | |
expecting <"new"> but rendering with <"shared/_header.rhtml"> | |
It seems like assert_layout is not taking a look at all the files rendered but just the first partial that was rendered or some variation on that. I've dug in to the @response object and I can't find any references to my app/views/sample/new.rhtml file. The only thing I could find was the contents of the new.rhtml file in a @cached_content_for_layout instance variable inside the @response object. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment