On 10/22/07, David Chelimsky <[EMAIL PROTECTED]> wrote: > Actually, it turns out that you can do this in a view spec: > > render "/path/to/my/file.html.erb", :layout => "application" > > and it will render with the layout. So you *could* (in theory, I > haven't done this yet) do something like this:
Actually - I had tried this before I sent the email - I just forgot to edit this part :) It does work. It's not perfect, but it does work. > > # spec/resources/views/layout_example.html.erb > <div>yielded from layout</div> > > # spec/views/layouts/application.html.erb_spec.rb > require File.dirname(__FILE__) + '/../../spec_helper' > > describe "/layouts/application" do > > it "should yield" do > render "/../../spec/resources/views/layout_example.html.erb", > :layout => "application" > response.should have_tag('div','yielded from layout') > end > > it "should have title" do > render "/../../spec/resources/views/layout_example.html.erb", > :layout => "application" > response.should have_tag("div.idbar","My Killer App") > end > ... > end > _______________________________________________ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users