blob: a2eeb443c42487b68fe4f608469e0bc750205417 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
require 'rails_helper'
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
|