Browse files

Added help page

  • Loading branch information...
1 parent 3331b89 commit 123172dd7ea618e9ecf0e77d3b9a91fcb572d30f @ryanmaclear committed Feb 23, 2011
View
BIN app/controllers/.pages_controller.rb.swp
Binary file not shown.
View
4 app/controllers/pages_controller.rb
@@ -11,4 +11,8 @@ def about
@title = "About"
end
+ def help
+ @title = "Help"
+ end
+
end
View
7 app/views/pages/help.html.erb
@@ -0,0 +1,7 @@
+<h1>Help</h1>
+<p>
+Get help on Ruby on Rails Tutorial at the
+<a href="http://railstutorial.org/help">Rails Tutorial help page</a>.
+To get help on this sample app, see the
+<a href="http://railstutorial.org/book">Rails Tutorial book</a>.
+</p>
View
BIN config/.routes.rb.swp
Binary file not shown.
View
2 config/routes.rb
@@ -5,6 +5,8 @@
get "pages/about"
+ get "pages/help"
+
# The priority is based upon order of creation:
# first created -> highest priority.
View
23 spec/controllers/pages_controller_spec.rb
@@ -3,6 +3,10 @@
describe PagesController do
render_views
+ before(:each) do
+ @base_title = "Ruby on Rails Tutorial Sample App"
+ end
+
describe "GET 'home'" do
it "should be successful" do
get 'home'
@@ -12,7 +16,7 @@
it "should have the right title" do
get 'home'
response.should have_selector("title",
- :content => "Ruby on Rails Tutorial Sample App | Home")
+ :content => @base_title+" | Home")
end
end
@@ -25,7 +29,7 @@
it "should have the right title" do
get 'contact'
response.should have_selector("title",
- :content => "Ruby on Rails Tutorial Sample App | Contact")
+ :content => @base_title+" | Contact")
end
end
@@ -38,7 +42,20 @@
it "should have the right title" do
get 'about'
response.should have_selector("title",
- :content => "Ruby on Rails Tutorial Sample App | About")
+ :content => @base_title+" | About")
+ end
+ end
+
+ describe "GET 'help'" do
+ it "should be successful" do
+ get 'help'
+ response.should be_success
+ end
+
+ it "should have the right title" do
+ get 'help'
+ response.should have_selector("title",
+ :content => @base_title+" | Help")
end
end

0 comments on commit 123172d

Please sign in to comment.