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>2019-09-18 17:14:39 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2019-09-18 17:14:39 +0300
commit1eb82b65c554f21d83447f895a6208905fabe112 (patch)
treeab12f01b3dc46f11c02afea1e470a78f06ca70c2 /spec/support
parent4ab54c2233e91f60a80e5b6fa2181e6899fdcc3e (diff)
Add latest changes from gitlab-org/gitlab@12-3-auto-deploy-20190916stable-branch-foss-test
Diffstat (limited to 'spec/support')
-rw-r--r--spec/support/helpers/jira_service_helper.rb18
-rw-r--r--spec/support/shared_contexts/finders/issues_finder_shared_contexts.rb2
-rw-r--r--spec/support/shared_examples/controllers/application_settings_shared_examples.rb26
-rw-r--r--spec/support/shared_examples/finders/assignees_filter_shared_examples.rb12
-rw-r--r--spec/support/shared_examples/models/cluster_application_core_shared_examples.rb4
-rw-r--r--spec/support/shared_examples/requests/api/issues_shared_examples.rb21
6 files changed, 9 insertions, 74 deletions
diff --git a/spec/support/helpers/jira_service_helper.rb b/spec/support/helpers/jira_service_helper.rb
index c23a8d52c84..57c33c81ea3 100644
--- a/spec/support/helpers/jira_service_helper.rb
+++ b/spec/support/helpers/jira_service_helper.rb
@@ -5,16 +5,16 @@ module JiraServiceHelper
JIRA_API = JIRA_URL + "/rest/api/2"
def jira_service_settings
- title = "Jira tracker"
- url = JIRA_URL
- username = 'jira-user'
- password = 'my-secret-password'
- jira_issue_transition_id = '1'
+ properties = {
+ title: "Jira tracker",
+ url: JIRA_URL,
+ username: 'jira-user',
+ password: 'my-secret-password',
+ project_key: "JIRA",
+ jira_issue_transition_id: '1'
+ }
- jira_tracker.update(
- title: title, url: url, username: username, password: password,
- jira_issue_transition_id: jira_issue_transition_id, active: true
- )
+ jira_tracker.update(properties: properties, active: true)
end
def jira_issue_comments
diff --git a/spec/support/shared_contexts/finders/issues_finder_shared_contexts.rb b/spec/support/shared_contexts/finders/issues_finder_shared_contexts.rb
index 6c96b18d834..26ab6fbd400 100644
--- a/spec/support/shared_contexts/finders/issues_finder_shared_contexts.rb
+++ b/spec/support/shared_contexts/finders/issues_finder_shared_contexts.rb
@@ -12,7 +12,6 @@ RSpec.shared_context 'IssuesFinder context' do
set(:project3) { create(:project, group: subgroup) }
set(:milestone) { create(:milestone, project: project1) }
set(:label) { create(:label, project: project2) }
- set(:label2) { create(:label, project: project2) }
set(:issue1) { create(:issue, author: user, assignees: [user], project: project1, milestone: milestone, title: 'gitlab', created_at: 1.week.ago, updated_at: 1.week.ago) }
set(:issue2) { create(:issue, author: user, assignees: [user], project: project2, description: 'gitlab', created_at: 1.week.from_now, updated_at: 1.week.from_now) }
set(:issue3) { create(:issue, author: user2, assignees: [user2], project: project2, title: 'tanuki', description: 'tanuki', created_at: 2.weeks.from_now, updated_at: 2.weeks.from_now) }
@@ -25,7 +24,6 @@ end
RSpec.shared_context 'IssuesFinder#execute context' do
let!(:closed_issue) { create(:issue, author: user2, assignees: [user2], project: project2, state: 'closed') }
let!(:label_link) { create(:label_link, label: label, target: issue2) }
- let!(:label_link2) { create(:label_link, label: label2, target: issue3) }
let(:search_user) { user }
let(:params) { {} }
let(:issues) { described_class.new(search_user, params.reverse_merge(scope: scope, state: 'opened')).execute }
diff --git a/spec/support/shared_examples/controllers/application_settings_shared_examples.rb b/spec/support/shared_examples/controllers/application_settings_shared_examples.rb
deleted file mode 100644
index 9619451cd14..00000000000
--- a/spec/support/shared_examples/controllers/application_settings_shared_examples.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-# frozen_string_literal: true
-
-shared_examples 'renders correct panels' do
- it 'renders correct action on error' do
- expect_next_instance_of(ApplicationSettings::UpdateService) do |service|
- allow(service).to receive(:execute).and_return(false)
- end
-
- patch action, params: { application_setting: { unused_param: true } }
-
- expect(subject).to render_template(action)
- end
-
- it 'redirects to same panel on success' do
- expect_next_instance_of(ApplicationSettings::UpdateService) do |service|
- allow(service).to receive(:execute).and_return(true)
- end
-
- referer_path = public_send("#{action}_admin_application_settings_path")
- request.env["HTTP_REFERER"] = referer_path
-
- patch action, params: { application_setting: { unused_param: true } }
-
- expect(subject).to redirect_to(referer_path)
- end
-end
diff --git a/spec/support/shared_examples/finders/assignees_filter_shared_examples.rb b/spec/support/shared_examples/finders/assignees_filter_shared_examples.rb
index f1df1052ef2..a931c4df99f 100644
--- a/spec/support/shared_examples/finders/assignees_filter_shared_examples.rb
+++ b/spec/support/shared_examples/finders/assignees_filter_shared_examples.rb
@@ -6,24 +6,12 @@ shared_examples 'assignee ID filter' do
end
end
-shared_examples 'assignee NOT ID filter' do
- it 'returns issuables not assigned to that user' do
- expect(issuables).to contain_exactly(*expected_issuables)
- end
-end
-
shared_examples 'assignee username filter' do
it 'returns issuables assigned to those users' do
expect(issuables).to contain_exactly(*expected_issuables)
end
end
-shared_examples 'assignee NOT username filter' do
- it 'returns issuables not assigned to those users' do
- expect(issuables).to contain_exactly(*expected_issuables)
- end
-end
-
shared_examples 'no assignee filter' do
let(:params) { { assignee_id: 'None' } }
diff --git a/spec/support/shared_examples/models/cluster_application_core_shared_examples.rb b/spec/support/shared_examples/models/cluster_application_core_shared_examples.rb
index affe88be475..8e58cc7ba22 100644
--- a/spec/support/shared_examples/models/cluster_application_core_shared_examples.rb
+++ b/spec/support/shared_examples/models/cluster_application_core_shared_examples.rb
@@ -21,8 +21,4 @@ shared_examples 'cluster application core specs' do |application_name|
expect(Clusters::Cluster::APPLICATIONS[subject.name]).to eq(described_class)
end
end
-
- describe '.association_name' do
- it { expect(described_class.association_name).to eq(:"application_#{subject.name}") }
- end
end
diff --git a/spec/support/shared_examples/requests/api/issues_shared_examples.rb b/spec/support/shared_examples/requests/api/issues_shared_examples.rb
index d22210edf99..1133e95e44e 100644
--- a/spec/support/shared_examples/requests/api/issues_shared_examples.rb
+++ b/spec/support/shared_examples/requests/api/issues_shared_examples.rb
@@ -8,13 +8,6 @@ shared_examples 'labeled issues with labels and label_name params' do
end
end
- shared_examples 'returns negated label names' do
- it 'returns label names' do
- expect_paginated_array_response(issue2.id)
- expect(json_response.first['labels']).to eq([label_b.title, label.title])
- end
- end
-
shared_examples 'returns basic label entity' do
it 'returns basic label entity' do
expect_paginated_array_response(issue.id)
@@ -35,20 +28,6 @@ shared_examples 'labeled issues with labels and label_name params' do
it_behaves_like 'returns label names'
end
- context 'negation' do
- context 'array of labeled issues when all labels match with negation' do
- let(:params) { { labels: "#{label.title},#{label_b.title}", not: { labels: "#{label_c.title}" } } }
-
- it_behaves_like 'returns negated label names'
- end
-
- context 'array of labeled issues when all labels match with negation with label params as array' do
- let(:params) { { labels: [label.title, label_b.title], not: { labels: [label_c.title] } } }
-
- it_behaves_like 'returns negated label names'
- end
- end
-
context 'when with_labels_details provided' do
context 'array of labeled issues when all labels match' do
let(:params) { { labels: "#{label.title},#{label_b.title},#{label_c.title}", with_labels_details: true } }