summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Jankowski <matt@jankowski.online>2024-03-18 09:24:59 -0400
committerGitHub <noreply@github.com>2024-03-18 13:24:59 +0000
commit6d2986017e908b0f4fb88baca0902203e5beb177 (patch)
treea6833a33d7b90755f4a6146095c674a04e2ab401
parentd5063072c3d7a882456f09cb70e664a2aeec7d81 (diff)
Remove unused `active_nav_class` helper method (#29617)
-rw-r--r--app/helpers/application_helper.rb4
-rw-r--r--spec/helpers/application_helper_spec.rb24
2 files changed, 0 insertions, 28 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 18c9663275e..7dc7d60808f 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -28,10 +28,6 @@ module ApplicationHelper
number_to_human(number, **options)
end
- def active_nav_class(*paths)
- paths.any? { |path| current_page?(path) } ? 'active' : ''
- end
-
def open_registrations?
Setting.registrations_mode == 'open'
end
diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb
index 6fc6b3c0877..9330eb0dae1 100644
--- a/spec/helpers/application_helper_spec.rb
+++ b/spec/helpers/application_helper_spec.rb
@@ -3,30 +3,6 @@
require 'rails_helper'
describe ApplicationHelper do
- describe 'active_nav_class' do
- it 'returns active when on the current page' do
- allow(helper).to receive(:current_page?).and_return(true)
-
- result = helper.active_nav_class('/test')
- expect(result).to eq 'active'
- end
-
- it 'returns active when on a current page' do
- allow(helper).to receive(:current_page?).with('/foo').and_return(false)
- allow(helper).to receive(:current_page?).with('/test').and_return(true)
-
- result = helper.active_nav_class('/foo', '/test')
- expect(result).to eq 'active'
- end
-
- it 'returns empty string when not on current page' do
- allow(helper).to receive(:current_page?).and_return(false)
-
- result = helper.active_nav_class('/test')
- expect(result).to eq ''
- end
- end
-
describe 'body_classes' do
context 'with a body class string from a controller' do
before { helper.extend controller_helpers }