summaryrefslogtreecommitdiff
path: root/spec/helpers/application_helper_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/helpers/application_helper_spec.rb')
-rw-r--r--spec/helpers/application_helper_spec.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb
index d679768be6c..05231cc6d09 100644
--- a/spec/helpers/application_helper_spec.rb
+++ b/spec/helpers/application_helper_spec.rb
@@ -71,6 +71,28 @@ describe ApplicationHelper do
end
end
+ describe '#admin_section?' do
+ context 'when controller is under the admin namespace' do
+ before do
+ allow(helper).to receive(:controller).and_return(Admin::UsersController.new)
+ end
+
+ it 'returns true' do
+ expect(helper.admin_section?).to eq(true)
+ end
+ end
+
+ context 'when controller is not under the admin namespace' do
+ before do
+ allow(helper).to receive(:controller).and_return(UsersController.new)
+ end
+
+ it 'returns true' do
+ expect(helper.admin_section?).to eq(false)
+ end
+ end
+ end
+
describe 'simple_sanitize' do
let(:a_tag) { '<a href="#">Foo</a>' }