Created
January 23, 2012 20:25
-
-
Save leemcalilly/1665365 to your computer and use it in GitHub Desktop.
index.html.erb_spec.rb
This file contains hidden or 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
require "spec_helper" | |
describe "search/index.html.erb" do | |
context "when search results are empty" do | |
before do | |
assign(:results, double('results').as_null_object) | |
controller.params[:search] = "user query" | |
template.stub(:paginate).and_return(nil) | |
end | |
it "should display 'Sorry - no results' message" do | |
render | |
rendered.should match('<p>Sorry - there were no results for "<strong>user query</strong>".</p> | |
<p><a href="/">Return to your homepage</a>.</p>') | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment