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
path: root/spec
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-10-28 12:06:04 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2019-10-28 12:06:04 +0300
commit29eea410c440212730a33ddf610483fe095c8670 (patch)
treeb3071ada8f9524f99bf8479006553b8146365792 /spec
parent1a3d7b9fcda9e4eecd22b84f4254efc07344b284 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec')
-rw-r--r--spec/features/populate_new_pipeline_vars_with_params_spec.rb32
-rw-r--r--spec/finders/todos_finder_spec.rb23
-rw-r--r--spec/requests/api/merge_requests_spec.rb2
3 files changed, 57 insertions, 0 deletions
diff --git a/spec/features/populate_new_pipeline_vars_with_params_spec.rb b/spec/features/populate_new_pipeline_vars_with_params_spec.rb
new file mode 100644
index 00000000000..5fe80e73e38
--- /dev/null
+++ b/spec/features/populate_new_pipeline_vars_with_params_spec.rb
@@ -0,0 +1,32 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+describe "Populate new pipeline CI variables with url params", :js do
+ let(:user) { create(:user) }
+ let(:project) { create(:project) }
+ let(:page_path) { new_project_pipeline_path(project) }
+
+ before do
+ sign_in(user)
+ project.add_maintainer(user)
+
+ visit "#{page_path}?var[key1]=value1&file_var[key2]=value2"
+ end
+
+ it "var[key1]=value1 populates env_var variable correctly" do
+ page.within('.ci-variable-list .js-row:nth-child(1)') do
+ expect(find('.js-ci-variable-input-variable-type').value).to eq('env_var')
+ expect(find('.js-ci-variable-input-key').value).to eq('key1')
+ expect(find('.js-ci-variable-input-value').text).to eq('value1')
+ end
+ end
+
+ it "file_var[key2]=value2 populates file variable correctly" do
+ page.within('.ci-variable-list .js-row:nth-child(2)') do
+ expect(find('.js-ci-variable-input-variable-type').value).to eq('file')
+ expect(find('.js-ci-variable-input-key').value).to eq('key2')
+ expect(find('.js-ci-variable-input-value').text).to eq('value2')
+ end
+ end
+end
diff --git a/spec/finders/todos_finder_spec.rb b/spec/finders/todos_finder_spec.rb
index a4b076bc367..6234d596745 100644
--- a/spec/finders/todos_finder_spec.rb
+++ b/spec/finders/todos_finder_spec.rb
@@ -140,6 +140,29 @@ describe TodosFinder do
end
end
end
+
+ context 'by state' do
+ let!(:todo1) { create(:todo, user: user, group: group, target: issue, state: :done) }
+ let!(:todo2) { create(:todo, user: user, group: group, target: issue, state: :pending) }
+
+ it 'returns the expected items when no state is provided' do
+ todos = finder.new(user, {}).execute
+
+ expect(todos).to match_array([todo2])
+ end
+
+ it 'returns the expected items when a state is provided' do
+ todos = finder.new(user, { state: :done }).execute
+
+ expect(todos).to match_array([todo1])
+ end
+
+ it 'returns the expected items when multiple states are provided' do
+ todos = finder.new(user, { state: [:pending, :done] }).execute
+
+ expect(todos).to match_array([todo1, todo2])
+ end
+ end
end
context 'external authorization' do
diff --git a/spec/requests/api/merge_requests_spec.rb b/spec/requests/api/merge_requests_spec.rb
index 721998ede6a..443682cd34c 100644
--- a/spec/requests/api/merge_requests_spec.rb
+++ b/spec/requests/api/merge_requests_spec.rb
@@ -775,6 +775,8 @@ describe API::MergeRequests do
expect(json_response['merge_error']).to eq(merge_request.merge_error)
expect(json_response['user']['can_merge']).to be_truthy
expect(json_response).not_to include('rebase_in_progress')
+ expect(json_response['has_conflicts']).to be_falsy
+ expect(json_response['blocking_discussions_resolved']).to be_truthy
end
it 'exposes description and title html when render_html is true' do