This repository has been archived on 2024-06-09. You can view files and clone it, but cannot push or open issues/pull-requests.
2016-02-26 15:28:08 +01:00
|
|
|
require 'rails_helper'
|
|
|
|
|
2017-04-09 17:11:37 +02:00
|
|
|
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)
|
2016-02-26 15:28:08 +01:00
|
|
|
|
2017-04-09 17:11:37 +02:00
|
|
|
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
|
2016-02-26 15:28:08 +01:00
|
|
|
end
|