[READ-ONLY] Mirror of https://github.com/shuuji3/rails-tutorial-sample-app.
0

Configure Feed

Select the types of activity you want to include in your feed.

Add setup() to do DRY.

+7 -3
+7 -3
test/controllers/static_pages_controller_test.rb
··· 1 1 require 'test_helper' 2 2 3 3 class StaticPagesControllerTest < ActionDispatch::IntegrationTest 4 + def setup 5 + @base_title = "Ruby on Rails Tutorial Sample App" 6 + end 7 + 4 8 test "should get home" do 5 9 get static_pages_home_url 6 10 assert_response :success 7 - assert_select "title", "Home | Ruby on Rails Tutorial Sample App" 11 + assert_select "title", "Home | #{@base_title}" 8 12 end 9 13 10 14 test "should get help" do 11 15 get static_pages_help_url 12 16 assert_response :success 13 - assert_select "title", "Help | Ruby on Rails Tutorial Sample App" 17 + assert_select "title", "Help | #{@base_title}" 14 18 end 15 19 16 20 test 'should get about' do 17 21 get static_pages_about_url 18 22 assert_response :success 19 - assert_select "title", "About | Ruby on Rails Tutorial Sample App" 23 + assert_select "title", "About | #{@base_title}" 20 24 end 21 25 end