File tree Expand file tree Collapse file tree 4 files changed +22
-3
lines changed Expand file tree Collapse file tree 4 files changed +22
-3
lines changed Original file line number Diff line number Diff line change 7
7
8
8
def about
9
9
end
10
+ def contact
11
+ end
10
12
end
Original file line number Diff line number Diff line change
1
+ <% provide(:title, "Contact") %>
2
+ < h1 > Contact</ h1 >
3
+ < p >
4
+ Contact the Ruby on Rails Tutorial about the sample app at the
5
+ < a href ="http://www.railstutorial.org/#contact "> contact page</ a > .
6
+ </ p >
Original file line number Diff line number Diff line change 2
2
root 'static_pages#home'
3
3
get 'static_pages/help'
4
4
get 'static_pages/about'
5
+ get 'static_pages/contact'
5
6
6
7
7
8
# The priority is based upon order of creation: first created -> highest priority.
Original file line number Diff line number Diff line change 1
1
require 'test_helper'
2
2
3
3
class StaticPagesControllerTest < ActionController ::TestCase
4
+
5
+ def setup
6
+ @base_title = "Ruby on Rails Tutorial Sample App"
7
+
8
+ end
4
9
test "should get home" do
5
10
get :home
6
11
assert_response :success
7
- assert_select "title" , "Home | Ruby on Rails Tutorial Sample App "
12
+ assert_select "title" , "Home | #{ @base_title } "
8
13
end
9
14
test "should get about" do
10
15
get :about
11
16
assert_response :success
12
- assert_select "title" , "About | Ruby on Rails Tutorial Sample App "
17
+ assert_select "title" , "About | #{ @base_title } "
13
18
end
14
19
15
20
test "should get help" do
16
21
get :help
17
22
assert_response :success
18
- assert_select "title" , "Help | Ruby on Rails Tutorial Sample App"
23
+ assert_select "title" , "Help | #{ @base_title } "
24
+ end
25
+ test "should get contact" do
26
+ get :contact
27
+ assert_response :success
28
+ assert_select "title" , "Contact | #{ @base_title } "
19
29
end
20
30
#test "shout get about" do
21
31
# get :static_pages_help_url
You can’t perform that action at this time.
0 commit comments