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>2020-04-13 15:10:03 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-04-13 15:10:03 +0300
commit75ee59f7a108cf0c57e1e66e3ef5e439bae24fcd (patch)
treeb2f1ec89e16c6b27041f608c9fb12b7586e5ce94 /spec/lib/gitlab/static_site_editor
parente79918ce90dc31527be1ef0140a99cfe450d931e (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/gitlab/static_site_editor')
-rw-r--r--spec/lib/gitlab/static_site_editor/config_spec.rb30
1 files changed, 30 insertions, 0 deletions
diff --git a/spec/lib/gitlab/static_site_editor/config_spec.rb b/spec/lib/gitlab/static_site_editor/config_spec.rb
new file mode 100644
index 00000000000..dea79fb0e92
--- /dev/null
+++ b/spec/lib/gitlab/static_site_editor/config_spec.rb
@@ -0,0 +1,30 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+describe Gitlab::StaticSiteEditor::Config do
+ subject(:config) { described_class.new(repository, ref, file_path, return_url) }
+
+ let(:project) { create(:project, :public, :repository, name: 'project', namespace: namespace) }
+ let(:namespace) { create(:namespace, name: 'namespace') }
+ let(:repository) { project.repository }
+ let(:ref) { 'master' }
+ let(:file_path) { 'README.md' }
+ let(:return_url) { 'http://example.com' }
+
+ describe '#payload' do
+ subject { config.payload }
+
+ it 'returns data for the frontend component' do
+ is_expected.to eq(
+ branch: 'master',
+ commit: repository.commit.id,
+ namespace: 'namespace',
+ path: 'README.md',
+ project: 'project',
+ project_id: project.id,
+ return_url: 'http://example.com'
+ )
+ end
+ end
+end