This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Ruby on Rails Tutorial Sample App | Home</title> | |
</head> | |
<body> | |
<h1>Sample App</h1> | |
<p> | |
This is the home page for the | |
<a href="http://railstutorial.org/">Ruby on Rails Tutorial</a> | |
sample application. | |
</p> | |
</body> | |
</html> |
This file contains 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 PagesController do | |
describe "GET 'home'" do | |
it "returns http success" do | |
get 'home' | |
response.should be_success | |
end | |
it "should have the right title" do | |
get 'home' | |
response.should have_selector("title", | |
:content => "Ruby on Rails Tutorial Sample App | Home") | |
end | |
end | |
describe "GET 'contact'" do | |
it "returns http success" do | |
get 'contact' | |
response.should be_success | |
end | |
end | |
describe "GET 'about'" do | |
it "returns http success" do | |
get 'about' | |
response.should be_success | |
end | |
end | |
end |
This file contains 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
Failures: | |
1) PagesController GET 'home' should have the right title | |
Failure/Error: response.should have_selector("title", | |
expected css "title" to return something | |
# ./spec/controllers/pages_controller_spec.rb:13:in `block (3 levels) in <top (required)>' | |
Finished in 4.7 seconds | |
4 examples, 1 failure | |
Failed examples: | |
rspec ./spec/controllers/pages_controller_spec.rb:11 # PagesController GET 'home' should have the right title |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment