Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-05-19 12:09:08 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-05-19 12:09:08 +0300
commit3fbfc0075a306ad85c70c006b978a2e96bd4283a (patch)
tree077f6cf9013638b21a1242355d2fd13069533f73 /spec/views/layouts
parent224d2fe16768ee5b270d894a5ed47101bf454d04 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/views/layouts')
-rw-r--r--spec/views/layouts/application.html.haml_spec.rb29
1 files changed, 29 insertions, 0 deletions
diff --git a/spec/views/layouts/application.html.haml_spec.rb b/spec/views/layouts/application.html.haml_spec.rb
index 679d0b1ff60..0f359219718 100644
--- a/spec/views/layouts/application.html.haml_spec.rb
+++ b/spec/views/layouts/application.html.haml_spec.rb
@@ -14,6 +14,35 @@ RSpec.describe 'layouts/application' do
allow(view).to receive(:current_user_mode).and_return(Gitlab::Auth::CurrentUserMode.new(user))
end
+ describe "visual review toolbar" do
+ context "ENV['REVIEW_APPS_ENABLED'] is set to true" do
+ before do
+ stub_env(
+ 'REVIEW_APPS_ENABLED' => true,
+ 'REVIEW_APPS_MERGE_REQUEST_IID' => '123'
+ )
+ end
+
+ it 'renders the visual review toolbar' do
+ render
+
+ expect(rendered).to include('review-app-toolbar-script')
+ end
+ end
+
+ context "ENV['REVIEW_APPS_ENABLED'] is set to false" do
+ before do
+ stub_env('REVIEW_APPS_ENABLED', false)
+ end
+
+ it 'does not render the visual review toolbar' do
+ render
+
+ expect(rendered).not_to include('review-app-toolbar-script')
+ end
+ end
+ end
+
context 'body data elements for pageview context' do
let(:body_data) do
{