about summary refs log tree commit diff
path: root/spec/helpers/application_helper_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/helpers/application_helper_spec.rb')
-rw-r--r--spec/helpers/application_helper_spec.rb16
1 files changed, 15 insertions, 1 deletions
diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb
index c2063c995..a2eeb443c 100644
--- a/spec/helpers/application_helper_spec.rb
+++ b/spec/helpers/application_helper_spec.rb
@@ -1,5 +1,19 @@
 require 'rails_helper'
 
-RSpec.describe ApplicationHelper, type: :helper do
+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 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
 end