Skip to content

Commit

Permalink
fix title and description page helper for recent activity pages
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanTG committed Jan 15, 2025
1 parent 895c60e commit d663181
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
8 changes: 6 additions & 2 deletions app/helpers/pages_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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."
Expand Down Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion spec/helpers/pages_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit d663181

Please sign in to comment.