From d66318164c8744ae084b6dde1ab074db033e548c Mon Sep 17 00:00:00 2001 From: RyanTG Date: Tue, 14 Jan 2025 21:59:07 -0800 Subject: [PATCH] fix title and description page helper for recent activity pages --- app/helpers/pages_helper.rb | 8 ++++++-- spec/helpers/pages_helper_spec.rb | 6 +++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/app/helpers/pages_helper.rb b/app/helpers/pages_helper.rb index f6392bbc..fde3e8c5 100644 --- a/app/helpers/pages_helper.rb +++ b/app/helpers/pages_helper.rb @@ -32,7 +32,7 @@ def title_for_region_path(path, region) title = 'Upcoming Events - ' elsif path == high_rollers_path(region.name) title = 'High Scores - ' - elsif path == activity_path(region.name) + elsif path == region_activity_path(region.name) title = 'Recent Activity - ' end @@ -67,6 +67,8 @@ def title_for_map_path(path) 'Suggest a New Location - ' elsif path == map_flier_path 'Promote ' + elsif path == activity_path + 'Recent Activity - ' else '' end @@ -89,7 +91,7 @@ def desc_for_region_path(path, region) "Upcoming pinball events in #{region.full_name}. Tournaments, leagues, charities, launch parties, and more!" elsif path == high_rollers_path(region.name) "High scores for the #{region.full_name} Pinball Map! If you get a high score on a pinball machine, add it to the map!" - elsif path == activity_path(region.name) + elsif path == region_activity_path(region.name) "Recent Activity for the #{region.full_name} Pinball Map! It's a list of the last 200 map edits!" else "Find local places to play pinball! The #{region.full_name} Pinball Map is a high-quality user-updated pinball locator for all the public pinball machines in your area." @@ -124,6 +126,8 @@ def desc_for_map_path(path) 'Add a new location to the Pinball Map! This crowdsourced map relies on your knowledge and help!' elsif path == map_flier_path 'Print out this cool promotional Pinball Map flier! Spread the word!' + elsif path == activity_path + "Recent Activity for Pinball Map! It's a list of the last 200 map edits!" else 'The Pinball Map website and free mobile app will help you find places to play pinball! Pinball Map is a high-quality user-updated pinball locator for all the public pinball machines in your area.' end diff --git a/spec/helpers/pages_helper_spec.rb b/spec/helpers/pages_helper_spec.rb index f98337cf..9f619661 100644 --- a/spec/helpers/pages_helper_spec.rb +++ b/spec/helpers/pages_helper_spec.rb @@ -67,6 +67,10 @@ it 'displays the correct flier title ' do expect(helper.title_for_path(map_flier_path)).to eq('Promote Pinball Map') end + + it 'displays the correct activity title ' do + expect(helper.title_for_path(activity_path)).to eq('Recent Activity - Pinball Map') + end end describe 'with region' do @@ -91,7 +95,7 @@ end it 'displays the recent activity title' do - expect(helper.title_for_path(activity_path(@region.name), @region)).to eq('Recent Activity - ' + @region.full_name + ' Pinball Map') + expect(helper.title_for_path(region_activity_path(@region.name), @region)).to eq('Recent Activity - ' + @region.full_name + ' Pinball Map') end end end