This project is archived and is in readonly mode.
@layouts in TemplateAssertions is +nil+
-
Neeraj Singh
Can you post your spec file?
-
Lawrence Pit
require 'spec_helper' describe CompaniesController do before(:each) do @company = Company.first end it "should render a company as xml" do request.env["HTTP_ACCEPT"] = "application/xml" get :show, :id => @company.id response.code.should == "200" response.content_type.should == "application/xml" should_equal_xml(response.body, %( <?xml version="1.0" encoding="UTF-8"?> <company> <name>Foo</name> <id type="integer">1</id> </company> )) end endThe trace is generated when the +get+ method is called.
As you may have noticed, I'm using rspec 2.0.0.beta.8, but I don't think it has anything to do with this. Probably I'd get the same result when using a plain unit test.
-
Lawrence Pit
I've recreated this situation as simple as possible in a new rails app. The app can be cloned from http://github.com/lawrencepit/layoutsnil. Run:
bundle install rake db:migrate:reset rake specA few points of interest I found out while trying to recreate this situation:
-
In the Gemfile it points to the rails edge code. If however you use the rails 3.0.0.beta3 code the specs succeed.
-
While rake spec fails, I've also created two unit tests that are similar, and they succeed.
-
The sample shows two controller specs. This seems essential to recreate the bug. Have only one controller spec, and the specs succeed.
-
Rename /app/views/companies to e.g. /app/views/companies.bak, and the specs succeed.
-
-
Santiago Pastorino
- State changed from new to open
This issue has been automatically marked as stale because it has not been commented on for at least three months.
The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.
Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.
-
Santiago Pastorino
- State changed from open to stale