diff --git a/test/functional/pages_controller_test.rb b/test/functional/pages_controller_test.rb index 9683eedf..c7cea336 100644 --- a/test/functional/pages_controller_test.rb +++ b/test/functional/pages_controller_test.rb @@ -8,5 +8,6 @@ def setup test 'should get how_to' do get :show, params: { id: 'how_to' } assert_response :success + assert response.body.include? '

How to

' end end diff --git a/test/functional/welcome_controller_test.rb b/test/functional/welcome_controller_test.rb index 803f23cd..8de09aba 100644 --- a/test/functional/welcome_controller_test.rb +++ b/test/functional/welcome_controller_test.rb @@ -12,6 +12,14 @@ class WelcomeControllerTest < ActionController::TestCase test 'should get index' do get :index assert_response :success + # It includes the public header + assert( + response.body.include?( + 'Tomatoes is a Pomodoro Technique® driven time tracker' + ) + ) + # It doesn't include the current user's list of tomatoes + assert_not response.body.include? 'Today's tomatoes' end test 'current user should get index' do @@ -19,5 +27,13 @@ class WelcomeControllerTest < ActionController::TestCase get :index assert_response :success + # It doesn't include the public header + assert_not( + response.body.include?( + 'Tomatoes is a Pomodoro Technique® driven time tracker' + ) + ) + # It includes the current user's list of tomatoes + assert response.body.include? 'Today's tomatoes' end end