Refactor active_nav_class for use with multiple paths (#8757)
This commit is contained in:
parent
d0d65b5a28
commit
c39183cc62
3 changed files with 11 additions and 3 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue