Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
require File.dirname(__FILE__) + '/../../spec_helper' describe "/adverts/_advert.rhtml" do # include AdvertsHelper before do advert = mock_model(Advert) advert.should_receive(:id).and_return("123") advert.should_receive(:title).and_return("AdvertTitle") advert.should_receive(:description).and_return("Description") assigns[:advert] = advert end it "should display an advert" do render "/adverts/_advert.rhtml" response.should have_tag('div#advert_123') do with_tag('h3', 'AdvertTitle') with_tag('p', 'Description') end end end
This paste will be private.
From the Design Piracy series on my blog: