Refactor active_nav_class for use with multiple paths (#8757)
This commit is contained in:
1 parent
d0d65b5a28
commit
c39183cc62
3 files changed
+11
-3
No files matched your search
@@ -9,6 +9,14 @@ describe ApplicationHelper do
|
||||
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)
|
||||
|
||||
|
||||
Reference in new issue
Block a user