1
+ require 'spec_helper'
2
+
3
+ describe "Static pages" do
4
+
5
+ describe "Home page" do
6
+
7
+ it "should have the h1 'Sample App'" do
8
+ visit '/static_pages/home'
9
+ page . should have_selector ( 'h1' , :text => 'Sample App' )
10
+ end
11
+
12
+ it "should have the title 'Home'" do
13
+ visit '/static_pages/home'
14
+ page . should have_selector ( 'title' ,
15
+ :text => "Ruby on Rails Tutorial Sample App | Home" )
16
+ end
17
+ end
18
+
19
+ describe "Help page" do
20
+
21
+ it "should have the h1 'Help'" do
22
+ visit '/static_pages/help'
23
+ page . should have_selector ( 'h1' , :text => 'Help' )
24
+ end
25
+
26
+ it "should have the title 'Help'" do
27
+ visit '/static_pages/help'
28
+ page . should have_selector ( 'title' ,
29
+ :text => "Ruby on Rails Tutorial Sample App | Help" )
30
+ end
31
+ end
32
+
33
+ describe "About page" do
34
+
35
+ it "should have the h1 'About Us'" do
36
+ visit '/static_pages/about'
37
+ page . should have_selector ( 'h1' , :text => 'About Us' )
38
+ end
39
+
40
+ it "should have the title 'About Us'" do
41
+ visit '/static_pages/about'
42
+ page . should have_selector ( 'title' ,
43
+ :text => "Ruby on Rails Tutorial Sample App | About Us" )
44
+ end
45
+ end
46
+ end
0 commit comments