Sha256: e6b4b4d0f035bbb3eb63712abc0359da2d29583dee11ae38936ffa2f816fa48d
Contents?: true
Size: 960 Bytes
Versions: 1
Compression:
Stored size: 960 Bytes
Contents
require 'spec_helper' describe FooController do include Capybara::DSL render_views context "renders views fetched from database with" do it "a basic template" do FactoryGirl.create(:database_template, :path => 'foo/default_layout') visit '/foo/default_layout' response.should render_template("foo/default_layout" ) page.body.should match(/something here in the body of the page: 4/) end it "a custom layout" do FactoryGirl.create(:database_template, :path => 'foo/custom_layout') FactoryGirl.create(:database_template, :path => 'layouts/custom', :body => 'This is a layout with body: <%= yield %>') visit '/foo/custom_layout' response.should render_template("layouts/custom" ) response.should render_template("foo/custom_layout" ) page.body.should match(/This is a layout with body:/) page.body.should match(/something here in the body of the page:/) end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
panoramic-0.0.4 | spec/controllers/rendering_spec.rb |