diff options
author | ThibG <thib@sitedethib.com> | 2018-09-23 20:42:13 +0200 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2018-09-23 20:42:13 +0200 |
commit | c39183cc628ea9556db53af5059656d6b63609ba (patch) | |
tree | 27e79ae58e4f5e1192a9ec638220f44fd71587fa /spec/helpers | |
parent | d0d65b5a2899546c4134d1fca60aef2c23c4932d (diff) |
Refactor active_nav_class for use with multiple paths (#8757)
Diffstat (limited to 'spec/helpers')
-rw-r--r-- | spec/helpers/application_helper_spec.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb index 3ccd96f44..61780b46b 100644 --- a/spec/helpers/application_helper_spec.rb +++ b/spec/helpers/application_helper_spec.rb @@ -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) |