Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add About and Help StaticPage and its specs

  • Loading branch information...
commit e13ae3bc8fc507a3bea36752819d8c082d027f5a 1 parent bec842e
@Hoornet authored
View
14 app/views/static_pages/about.html.erb
@@ -0,0 +1,14 @@
+
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Ruby on Rails Tutorial Sample App | About Us</title>
+</head>
+<body>
+<h1>About Us</h1>
+<p>
+ The <a href="http://railstutorial.org">Ruby on Rails tutorial</a> is a project
+ bla bla bla
+</p>
+</body>
+</html>
View
47 spec/requests/static_pages_spec.rb
@@ -0,0 +1,47 @@
+require 'spec_helper'
+
+describe "Static pages" do
+
+ describe "Home page" do
+ it "should have the content 'Sample App'" do
+ visit '/static_pages/home'
+ page.should have_selector('h1', :text=>'Sample App')
+ end
+
+ it 'should have the right title' do
+ visit '/static_pages/home'
+ page.should have_selector('title',
+ :text => "Ruby on Rails Tutorial Sample App | Home")
+ end
+ end
+
+ describe "Help page" do
+ it "should have the content 'Help'" do
+ visit '/static_pages/help'
+ page.should have_selector('h1', :text=>'Help')
+ end
+
+ it 'should have the right title' do
+ visit '/static_pages/help'
+ page.should have_selector('title',
+ :text => "Ruby on Rails Tutorial Sample App | Help")
+ end
+ end
+
+
+ describe "About page" do
+ it "should have the content 'About us'" do
+
+ visit '/static_pages/about'
+ page.should have_selector('h1', :text=>'About Us')
+ end
+ it 'should have the right title' do
+ visit '/static_pages/about'
+ page.should have_selector('title',
+ :text => "Ruby on Rails Tutorial Sample App | About Us")
+ end
+ end
+
+
+
+end
Please sign in to comment.
Something went wrong with that request. Please try again.