summaryrefslogtreecommitdiff
path: root/spec/helpers
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-12-03 00:08:13 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-12-03 00:08:13 +0000
commitf5ba3a32e2cf1819badffb04522c2cd8dac9bd99 (patch)
tree4a3b55ace49aeec9f60cf40735bed5219a1e0db6 /spec/helpers
parentec8cf3f7c8d9ac408a81af714db7a0640cf0199d (diff)
downloadgitlab-ce-f5ba3a32e2cf1819badffb04522c2cd8dac9bd99.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/helpers')
-rw-r--r--spec/helpers/application_helper_spec.rb26
1 files changed, 26 insertions, 0 deletions
diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb
index ac811b46c39..3384f9fea05 100644
--- a/spec/helpers/application_helper_spec.rb
+++ b/spec/helpers/application_helper_spec.rb
@@ -3,6 +3,8 @@
require 'spec_helper'
RSpec.describe ApplicationHelper do
+ include Devise::Test::ControllerHelpers
+
describe 'current_controller?' do
before do
stub_controller_name('foo')
@@ -685,4 +687,28 @@ RSpec.describe ApplicationHelper do
expect(helper.stylesheet_link_tag_defer('test')).to eq( '<link rel="stylesheet" media="screen" href="/stylesheets/test.css" />')
end
end
+
+ describe '#use_new_fonts?' do
+ subject { helper.use_new_fonts? }
+
+ it { is_expected.to eq true }
+
+ context 'when the feature flag is disabled' do
+ before do
+ stub_feature_flags(new_fonts: false)
+ end
+
+ it { is_expected.to eq false }
+
+ context 'with special request param' do
+ let(:request) { instance_double(ActionController::TestRequest, params: { new_fonts: true }) }
+
+ before do
+ allow(helper).to receive(:request).and_return(request)
+ end
+
+ it { is_expected.to eq true }
+ end
+ end
+ end
end