diff options
author | Matt Jankowski <mjankowski@thoughtbot.com> | 2017-04-09 11:11:37 -0400 |
---|---|---|
committer | Eugen <eugen@zeonfederated.com> | 2017-04-09 17:11:37 +0200 |
commit | ea6c930c04762bef00b42dad16a17b71b8acc93b (patch) | |
tree | 3760237e43060ee0ffe0362570266d95021cc910 /spec/helpers/application_helper_spec.rb | |
parent | 12e29c9660df3ce85f46715bb62a4a15ce38f6a5 (diff) |
Helper cleanup (#1348)
* Remove unused helper files * Add coverage for application helper * Add coverage for StreamEntriesHelper #display_name
Diffstat (limited to 'spec/helpers/application_helper_spec.rb')
-rw-r--r-- | spec/helpers/application_helper_spec.rb | 16 |
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 |