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:
Diffstat (limited to 'spec/helpers/tooling/visual_review_helper_spec.rb')
-rw-r--r--spec/helpers/tooling/visual_review_helper_spec.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/spec/helpers/tooling/visual_review_helper_spec.rb b/spec/helpers/tooling/visual_review_helper_spec.rb
new file mode 100644
index 00000000000..7fb9f5fadf2
--- /dev/null
+++ b/spec/helpers/tooling/visual_review_helper_spec.rb
@@ -0,0 +1,25 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+RSpec.describe Tooling::VisualReviewHelper do
+ describe '#visual_review_toolbar_options' do
+ subject(:result) { helper.visual_review_toolbar_options }
+
+ before do
+ stub_env('REVIEW_APPS_MERGE_REQUEST_IID', '123')
+ end
+
+ it 'returns the correct params' do
+ expect(result).to eq(
+ 'data-merge-request-id': '123',
+ 'data-mr-url': 'https://gitlab.com',
+ 'data-project-id': '278964',
+ 'data-project-path': 'gitlab-org/gitlab',
+ 'data-require-auth': false,
+ 'id': 'review-app-toolbar-script',
+ 'src': 'https://gitlab.com/assets/webpack/visual_review_toolbar.js'
+ )
+ end
+ end
+end