1
0
mirror of https://github.com/mastodon/mastodon synced 2024-12-01 08:18:22 +09:00
mastodon/spec/helpers/application_helper_spec.rb

20 lines
517 B
Ruby
Raw Normal View History

2016-02-26 23:28:08 +09:00
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)
2016-02-26 23:28:08 +09: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 23:28:08 +09:00
end