diff options
author | Robert Speicher <rspeicher@gmail.com> | 2012-09-26 23:06:07 +0400 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2012-09-27 00:32:26 +0400 |
commit | aa0c4b77b60acfc85d99e9eacaff25e34b136529 (patch) | |
tree | 231d34ab9cb1ac910147c490ec1edc0a975fec17 /spec | |
parent | afc4a75499b6678a643e6b62f703f8e7e1eb0f0a (diff) |
Add current_action? helper
Diffstat (limited to 'spec')
-rw-r--r-- | spec/helpers/application_helper_spec.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb index fb711dd8d71..a94d5505a91 100644 --- a/spec/helpers/application_helper_spec.rb +++ b/spec/helpers/application_helper_spec.rb @@ -20,6 +20,25 @@ describe ApplicationHelper do end end + describe 'current_action?' do + before do + stub!(:action_name).and_return('foo') + end + + it "returns true when action matches argument" do + current_action?(:foo).should be_true + end + + it "returns false when action does not match argument" do + current_action?(:bar).should_not be_true + end + + it "should take any number of arguments" do + current_action?(:baz, :bar).should_not be_true + current_action?(:baz, :bar, :foo).should be_true + end + end + describe "gravatar_icon" do let(:user_email) { 'user@email.com' } |