Add current_controller? helper method
Simplifies some of the "active tab" checks we're doing
This commit is contained in:
parent
95f0a41141
commit
3ad931ca92
2 changed files with 25 additions and 0 deletions
|
@ -1,6 +1,20 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe ApplicationHelper do
|
||||
describe 'current_controller?' do
|
||||
before do
|
||||
controller.stub!(:controller_name).and_return('foo')
|
||||
end
|
||||
|
||||
it "returns true when controller matches argument" do
|
||||
current_controller?(:foo).should be_true
|
||||
end
|
||||
|
||||
it "returns false when controller does not match argument" do
|
||||
current_controller?(:bar).should_not be_true
|
||||
end
|
||||
end
|
||||
|
||||
describe "gravatar_icon" do
|
||||
let(:user_email) { 'user@email.com' }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue