summaryrefslogtreecommitdiff
path: root/spec/lib
diff options
context:
space:
mode:
Diffstat (limited to 'spec/lib')
-rw-r--r--spec/lib/banzai/pipeline/gfm_pipeline_spec.rb6
-rw-r--r--spec/lib/container_registry/client_spec.rb1
-rw-r--r--spec/lib/gitlab/background_migration/add_gitlab_instance_administration_project_spec.rb234
-rw-r--r--spec/lib/gitlab/ci/build/step_spec.rb52
-rw-r--r--spec/lib/gitlab/ci/config/entry/job_spec.rb31
-rw-r--r--spec/lib/gitlab/ci/yaml_processor_spec.rb42
-rw-r--r--spec/lib/gitlab/discussions_diff/file_collection_spec.rb39
-rw-r--r--spec/lib/gitlab/encoding_helper_spec.rb1
-rw-r--r--spec/lib/gitlab/etag_caching/router_spec.rb9
-rw-r--r--spec/lib/gitlab/git/blame_spec.rb1
-rw-r--r--spec/lib/gitlab/git/blob_spec.rb2
-rw-r--r--spec/lib/gitlab/git/conflict/file_spec.rb1
-rw-r--r--spec/lib/gitlab/git/repository_spec.rb1
-rw-r--r--spec/lib/gitlab/git_spec.rb1
-rw-r--r--spec/lib/gitlab/hook_data/issuable_builder_spec.rb18
-rw-r--r--spec/lib/gitlab/import_export/all_models.yml8
-rw-r--r--spec/lib/gitlab/json_logger_spec.rb1
-rw-r--r--spec/lib/gitlab/path_regex_spec.rb1
-rw-r--r--spec/lib/gitlab/popen_spec.rb8
-rw-r--r--spec/lib/gitlab/project_search_results_spec.rb1
-rw-r--r--spec/lib/gitlab/regex_spec.rb1
-rw-r--r--spec/lib/gitlab/search/found_blob_spec.rb1
-rw-r--r--spec/lib/gitlab/url_blocker_spec.rb1
-rw-r--r--spec/lib/gitlab/usage_data_spec.rb16
-rw-r--r--spec/lib/gitlab_danger_spec.rb2
25 files changed, 71 insertions, 408 deletions
diff --git a/spec/lib/banzai/pipeline/gfm_pipeline_spec.rb b/spec/lib/banzai/pipeline/gfm_pipeline_spec.rb
index 47ea273ef3a..7eb63fea413 100644
--- a/spec/lib/banzai/pipeline/gfm_pipeline_spec.rb
+++ b/spec/lib/banzai/pipeline/gfm_pipeline_spec.rb
@@ -34,7 +34,7 @@ describe Banzai::Pipeline::GfmPipeline do
result = described_class.call(markdown, project: project)[:output]
link = result.css('a').first
- expect(link['href']).to eq 'http://issues.example.com/issues/12'
+ expect(link['href']).to eq 'http://issue-tracker.example.com/issues/12'
end
it 'parses cross-project references to regular issues' do
@@ -63,7 +63,7 @@ describe Banzai::Pipeline::GfmPipeline do
result = described_class.call(markdown, project: project)[:output]
link = result.css('a').first
- expect(link['href']).to eq 'http://issues.example.com/issues/12'
+ expect(link['href']).to eq 'http://issue-tracker.example.com/issues/12'
end
it 'allows to use long external reference syntax for Redmine' do
@@ -72,7 +72,7 @@ describe Banzai::Pipeline::GfmPipeline do
result = described_class.call(markdown, project: project)[:output]
link = result.css('a').first
- expect(link['href']).to eq 'http://issues.example.com/issues/12'
+ expect(link['href']).to eq 'http://issue-tracker.example.com/issues/12'
end
it 'parses cross-project references to regular issues' do
diff --git a/spec/lib/container_registry/client_spec.rb b/spec/lib/container_registry/client_spec.rb
index 6c2b338bfcd..bc5fddd12ba 100644
--- a/spec/lib/container_registry/client_spec.rb
+++ b/spec/lib/container_registry/client_spec.rb
@@ -1,3 +1,4 @@
+# coding: utf-8
# frozen_string_literal: true
require 'spec_helper'
diff --git a/spec/lib/gitlab/background_migration/add_gitlab_instance_administration_project_spec.rb b/spec/lib/gitlab/background_migration/add_gitlab_instance_administration_project_spec.rb
deleted file mode 100644
index 76062b191a8..00000000000
--- a/spec/lib/gitlab/background_migration/add_gitlab_instance_administration_project_spec.rb
+++ /dev/null
@@ -1,234 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-describe Gitlab::BackgroundMigration::AddGitlabInstanceAdministrationProject, :migration, schema: 20190725080128 do
- let(:application_settings) { table(:application_settings) }
- let(:users) { table(:users) }
- let(:projects) { table(:projects) }
- let(:namespaces) { table(:namespaces) }
- let(:members) { table(:members) }
-
- let(:service_class) do
- Gitlab::DatabaseImporters::SelfMonitoring::Project::CreateService
- end
-
- let(:prometheus_settings) do
- {
- enable: true,
- listen_address: 'localhost:9090'
- }
- end
-
- before do
- stub_env('IN_MEMORY_APPLICATION_SETTINGS', 'false')
-
- stub_config(prometheus: prometheus_settings)
- end
-
- describe 'perform' do
- context 'without application_settings' do
- it 'does not fail' do
- subject.perform
-
- expect(Project.count).to eq(0)
- end
- end
-
- context 'without admin users' do
- let!(:application_setting) { application_settings.create! }
-
- it 'does not fail' do
- subject.perform
-
- expect(Project.count).to eq(0)
- end
- end
-
- context 'with admin users' do
- let(:project) { Project.last }
- let(:group) { Group.last }
- let!(:application_setting) { application_settings.create! }
- let!(:user) { users.create!(admin: true, email: 'admin1@example.com', projects_limit: 10, state: :active) }
-
- before do
- stub_application_setting(allow_local_requests_from_web_hooks_and_services: true)
- end
-
- shared_examples 'has prometheus service' do |listen_address|
- it do
- subject.perform
-
- prometheus = project.prometheus_service
- expect(prometheus).to be_persisted
- expect(prometheus).not_to eq(nil)
- expect(prometheus.api_url).to eq(listen_address)
- expect(prometheus.active).to eq(true)
- expect(prometheus.manual_configuration).to eq(true)
- end
- end
-
- it_behaves_like 'has prometheus service', 'http://localhost:9090'
-
- it 'creates GitLab Instance Administrator group' do
- subject.perform
-
- expect(group).to be_persisted
- expect(group.name).to eq('GitLab Instance Administrators')
- expect(group.path).to start_with('gitlab-instance-administrators')
- expect(group.path.split('-').last.length).to eq(8)
- expect(group.visibility_level).to eq(service_class::VISIBILITY_LEVEL)
- end
-
- it 'creates project with internal visibility' do
- subject.perform
-
- expect(project.visibility_level).to eq(Gitlab::VisibilityLevel::INTERNAL)
- expect(project).to be_persisted
- end
-
- it 'creates project with correct name and description' do
- subject.perform
-
- path = 'administration/monitoring/gitlab_instance_administration_project/index'
- docs_path = Rails.application.routes.url_helpers.help_page_path(path)
-
- expect(project.name).to eq(service_class::PROJECT_NAME)
- expect(project.description).to eq(
- 'This project is automatically generated and will be used to help monitor this GitLab instance. ' \
- "[More information](#{docs_path})"
- )
- expect(File).to exist("doc/#{path}.md")
- end
-
- it 'adds all admins as maintainers' do
- admin1 = users.create!(admin: true, email: 'admin2@example.com', projects_limit: 10, state: :active)
- admin2 = users.create!(admin: true, email: 'admin3@example.com', projects_limit: 10, state: :active)
- users.create!(email: 'nonadmin1@example.com', projects_limit: 10, state: :active)
-
- subject.perform
-
- expect(project.owner).to eq(group)
- expect(group.members.collect(&:user).collect(&:id)).to contain_exactly(user.id, admin1.id, admin2.id)
- expect(group.members.collect(&:access_level)).to contain_exactly(
- Gitlab::Access::OWNER,
- Gitlab::Access::MAINTAINER,
- Gitlab::Access::MAINTAINER
- )
- end
-
- it 'saves the project id' do
- subject.perform
-
- application_setting.reload
- expect(application_setting.instance_administration_project_id).to eq(project.id)
- end
-
- it 'does not fail when a project already exists' do
- group = namespaces.create!(
- path: 'gitlab-instance-administrators',
- name: 'GitLab Instance Administrators',
- type: 'Group'
- )
- project = projects.create!(
- namespace_id: group.id,
- name: 'GitLab Instance Administration'
- )
-
- admin1 = users.create!(admin: true, email: 'admin4@example.com', projects_limit: 10, state: :active)
- admin2 = users.create!(admin: true, email: 'admin5@example.com', projects_limit: 10, state: :active)
-
- members.create!(
- user_id: admin1.id,
- source_id: group.id,
- source_type: 'Namespace',
- type: 'GroupMember',
- access_level: GroupMember::MAINTAINER,
- notification_level: NotificationSetting.levels[:global]
- )
- members.create!(
- user_id: admin2.id,
- source_id: group.id,
- source_type: 'Namespace',
- type: 'GroupMember',
- access_level: GroupMember::MAINTAINER,
- notification_level: NotificationSetting.levels[:global]
- )
-
- stub_application_setting(instance_administration_project: project)
-
- subject.perform
-
- expect(Project.last.id).to eq(project.id)
- expect(Group.last.id).to eq(group.id)
- end
-
- context 'when local requests from hooks and services are not allowed' do
- before do
- stub_application_setting(allow_local_requests_from_web_hooks_and_services: false)
- end
-
- it_behaves_like 'has prometheus service', 'http://localhost:9090'
-
- it 'does not overwrite the existing whitelist' do
- application_setting.update!(outbound_local_requests_whitelist: ['example.com'])
-
- subject.perform
-
- application_setting.reload
- expect(application_setting.outbound_local_requests_whitelist).to contain_exactly(
- 'example.com', 'localhost'
- )
- end
- end
-
- context 'with non default prometheus address' do
- let(:prometheus_settings) do
- {
- enable: true,
- listen_address: 'https://localhost:9090'
- }
- end
-
- it_behaves_like 'has prometheus service', 'https://localhost:9090'
- end
-
- context 'when prometheus setting is not present in gitlab.yml' do
- before do
- allow(Gitlab.config).to receive(:prometheus).and_raise(Settingslogic::MissingSetting)
- end
-
- it 'does not fail' do
- subject.perform
-
- expect(project.prometheus_service).to be_nil
- end
- end
-
- context 'when prometheus setting is disabled in gitlab.yml' do
- let(:prometheus_settings) do
- {
- enable: false,
- listen_address: 'localhost:9090'
- }
- end
-
- it 'does not configure prometheus' do
- subject.perform
-
- expect(project.prometheus_service).to be_nil
- end
- end
-
- context 'when prometheus listen address is blank in gitlab.yml' do
- let(:prometheus_settings) { { enable: true, listen_address: '' } }
-
- it 'does not configure prometheus' do
- subject.perform
-
- expect(project.prometheus_service).to be_nil
- end
- end
- end
- end
-end
diff --git a/spec/lib/gitlab/ci/build/step_spec.rb b/spec/lib/gitlab/ci/build/step_spec.rb
index 9c1a8cf5e91..84e6e0e177f 100644
--- a/spec/lib/gitlab/ci/build/step_spec.rb
+++ b/spec/lib/gitlab/ci/build/step_spec.rb
@@ -4,49 +4,39 @@ require 'spec_helper'
describe Gitlab::Ci::Build::Step do
describe '#from_commands' do
- subject { described_class.from_commands(job) }
+ shared_examples 'has correct script' do
+ subject { described_class.from_commands(job) }
- before do
- job.run!
- end
+ before do
+ job.run!
+ end
- shared_examples 'has correct script' do
it 'fabricates an object' do
expect(subject.name).to eq(:script)
expect(subject.script).to eq(script)
+ expect(subject.timeout).to eq(job.metadata_timeout)
expect(subject.when).to eq('on_success')
expect(subject.allow_failure).to be_falsey
end
end
context 'when script option is specified' do
- let(:job) { create(:ci_build, :no_options, options: { script: ["ls -la\necho aaa", "date"] }) }
- let(:script) { ["ls -la\necho aaa", 'date'] }
-
- it_behaves_like 'has correct script'
- end
-
- context 'when before and script option is specified' do
- let(:job) do
- create(:ci_build, options: {
- before_script: ["ls -la\necho aaa"],
- script: ["date"]
- })
+ it_behaves_like 'has correct script' do
+ let(:job) { create(:ci_build, :no_options, options: { script: ["ls -la\necho aaa", "date"] }) }
+ let(:script) { ["ls -la\necho aaa", 'date'] }
end
-
- let(:script) { ["ls -la\necho aaa", 'date'] }
-
- it_behaves_like 'has correct script'
end
- context 'when timeout option is specified in seconds' do
- let(:job) { create(:ci_build, options: { job_timeout: 3, script: ["ls -la\necho aaa", 'date'] }) }
- let(:script) { ["ls -la\necho aaa", 'date'] }
-
- it_behaves_like 'has correct script'
-
- it 'has job level timeout' do
- expect(subject.timeout).to eq(3)
+ context 'when before and script option is specified' do
+ it_behaves_like 'has correct script' do
+ let(:job) do
+ create(:ci_build, options: {
+ before_script: ["ls -la\necho aaa"],
+ script: ["date"]
+ })
+ end
+
+ let(:script) { ["ls -la\necho aaa", 'date'] }
end
end
end
@@ -67,12 +57,12 @@ describe Gitlab::Ci::Build::Step do
end
context 'when after_script is not empty' do
- let(:job) { create(:ci_build, options: { job_timeout: 60, script: ['bash'], after_script: ['ls -la', 'date'] }) }
+ let(:job) { create(:ci_build, options: { script: ['bash'], after_script: ['ls -la', 'date'] }) }
it 'fabricates an object' do
expect(subject.name).to eq(:after_script)
expect(subject.script).to eq(['ls -la', 'date'])
- expect(subject.timeout).to eq(60)
+ expect(subject.timeout).to eq(job.metadata_timeout)
expect(subject.when).to eq('always')
expect(subject.allow_failure).to be_truthy
end
diff --git a/spec/lib/gitlab/ci/config/entry/job_spec.rb b/spec/lib/gitlab/ci/config/entry/job_spec.rb
index 1c4887e87c4..1853efde350 100644
--- a/spec/lib/gitlab/ci/config/entry/job_spec.rb
+++ b/spec/lib/gitlab/ci/config/entry/job_spec.rb
@@ -417,37 +417,6 @@ describe Gitlab::Ci::Config::Entry::Job do
end
end
end
-
- context 'when timeout value is not correct' do
- context 'when it is higher than instance wide timeout' do
- let(:config) { { timeout: '3 months' } }
-
- it 'returns error about value too high' do
- expect(entry).not_to be_valid
- expect(entry.errors)
- .to include "job timeout should not exceed the limit"
- end
- end
-
- context 'when it is not a duration' do
- let(:config) { { timeout: 100 } }
-
- it 'returns error about wrong value' do
- expect(entry).not_to be_valid
- expect(entry.errors).to include 'job timeout should be a duration'
- end
- end
- end
-
- context 'when timeout value is correct' do
- let(:config) { { script: 'echo', timeout: '1m 1s' } }
-
- it 'returns correct timeout' do
- expect(entry).to be_valid
- expect(entry.errors).to be_empty
- expect(entry.timeout).to eq('1m 1s')
- end
- end
end
end
diff --git a/spec/lib/gitlab/ci/yaml_processor_spec.rb b/spec/lib/gitlab/ci/yaml_processor_spec.rb
index 8f2f23f6110..9d9a9ecda33 100644
--- a/spec/lib/gitlab/ci/yaml_processor_spec.rb
+++ b/spec/lib/gitlab/ci/yaml_processor_spec.rb
@@ -1134,48 +1134,6 @@ module Gitlab
end
end
- describe "Timeout" do
- let(:config) do
- {
- deploy_to_production: {
- stage: 'deploy',
- script: 'test'
- }
- }
- end
-
- let(:processor) { Gitlab::Ci::YamlProcessor.new(YAML.dump(config)) }
- let(:builds) { processor.stage_builds_attributes('deploy') }
-
- context 'when no timeout was provided' do
- it 'does not include job_timeout' do
- expect(builds.size).to eq(1)
- expect(builds.first[:options]).not_to include(:job_timeout)
- end
- end
-
- context 'when an invalid timeout was provided' do
- before do
- config[:deploy_to_production][:timeout] = 'not-a-number'
- end
-
- it 'raises an error for invalid number' do
- expect { builds }.to raise_error('jobs:deploy_to_production timeout should be a duration')
- end
- end
-
- context 'when some valid timeout was provided' do
- before do
- config[:deploy_to_production][:timeout] = '1m 3s'
- end
-
- it 'returns provided timeout value' do
- expect(builds.size).to eq(1)
- expect(builds.first[:options]).to include(job_timeout: 63)
- end
- end
- end
-
describe "Dependencies" do
let(:config) do
{
diff --git a/spec/lib/gitlab/discussions_diff/file_collection_spec.rb b/spec/lib/gitlab/discussions_diff/file_collection_spec.rb
index 6ef1e41450f..0489206458b 100644
--- a/spec/lib/gitlab/discussions_diff/file_collection_spec.rb
+++ b/spec/lib/gitlab/discussions_diff/file_collection_spec.rb
@@ -22,13 +22,11 @@ describe Gitlab::DiscussionsDiff::FileCollection do
note_diff_file_b.id => file_b_caching_content })
.and_call_original
- subject.load_highlight
+ subject.load_highlight([note_diff_file_a.id, note_diff_file_b.id])
end
it 'does not write cache for already cached file' do
- file_a_caching_content = diff_note_a.diff_file.highlighted_diff_lines.map(&:to_hash)
- Gitlab::DiscussionsDiff::HighlightCache
- .write_multiple({ note_diff_file_a.id => file_a_caching_content })
+ subject.load_highlight([note_diff_file_a.id])
file_b_caching_content = diff_note_b.diff_file.highlighted_diff_lines.map(&:to_hash)
@@ -37,42 +35,27 @@ describe Gitlab::DiscussionsDiff::FileCollection do
.with({ note_diff_file_b.id => file_b_caching_content })
.and_call_original
- subject.load_highlight
+ subject.load_highlight([note_diff_file_a.id, note_diff_file_b.id])
end
- it 'does not write cache for resolved notes' do
- diff_note_a.update_column(:resolved_at, Time.now)
-
- file_b_caching_content = diff_note_b.diff_file.highlighted_diff_lines.map(&:to_hash)
-
- expect(Gitlab::DiscussionsDiff::HighlightCache)
- .to receive(:write_multiple)
- .with({ note_diff_file_b.id => file_b_caching_content })
- .and_call_original
-
- subject.load_highlight
+ it 'does not err when given ID does not exist in @collection' do
+ expect { subject.load_highlight([999]) }.not_to raise_error
end
it 'loaded diff files have highlighted lines loaded' do
- subject.load_highlight
+ subject.load_highlight([note_diff_file_a.id])
- diff_file_a = subject.find_by_id(note_diff_file_a.id)
- diff_file_b = subject.find_by_id(note_diff_file_b.id)
+ diff_file = subject.find_by_id(note_diff_file_a.id)
- expect(diff_file_a).to be_highlight_loaded
- expect(diff_file_b).to be_highlight_loaded
+ expect(diff_file.highlight_loaded?).to be(true)
end
it 'not loaded diff files does not have highlighted lines loaded' do
- diff_note_a.update_column(:resolved_at, Time.now)
-
- subject.load_highlight
+ subject.load_highlight([note_diff_file_a.id])
- diff_file_a = subject.find_by_id(note_diff_file_a.id)
- diff_file_b = subject.find_by_id(note_diff_file_b.id)
+ diff_file = subject.find_by_id(note_diff_file_b.id)
- expect(diff_file_a).not_to be_highlight_loaded
- expect(diff_file_b).to be_highlight_loaded
+ expect(diff_file.highlight_loaded?).to be(false)
end
end
end
diff --git a/spec/lib/gitlab/encoding_helper_spec.rb b/spec/lib/gitlab/encoding_helper_spec.rb
index fc08719fb33..b24b71522ec 100644
--- a/spec/lib/gitlab/encoding_helper_spec.rb
+++ b/spec/lib/gitlab/encoding_helper_spec.rb
@@ -1,3 +1,4 @@
+# coding: utf-8
# frozen_string_literal: true
require "spec_helper"
diff --git a/spec/lib/gitlab/etag_caching/router_spec.rb b/spec/lib/gitlab/etag_caching/router_spec.rb
index fbc49d894a6..8fcd4eb3c21 100644
--- a/spec/lib/gitlab/etag_caching/router_spec.rb
+++ b/spec/lib/gitlab/etag_caching/router_spec.rb
@@ -92,6 +92,15 @@ describe Gitlab::EtagCaching::Router do
expect(result).to be_blank
end
+ it 'matches the cluster environments path' do
+ result = described_class.match(
+ '/my-group/my-project/-/clusters/47/environments'
+ )
+
+ expect(result).to be_present
+ expect(result.name).to eq 'cluster_environments'
+ end
+
it 'matches the environments path' do
result = described_class.match(
'/my-group/my-project/environments.json'
diff --git a/spec/lib/gitlab/git/blame_spec.rb b/spec/lib/gitlab/git/blame_spec.rb
index ac085e2c266..0010c0304eb 100644
--- a/spec/lib/gitlab/git/blame_spec.rb
+++ b/spec/lib/gitlab/git/blame_spec.rb
@@ -1,3 +1,4 @@
+# coding: utf-8
require "spec_helper"
describe Gitlab::Git::Blame, :seed_helper do
diff --git a/spec/lib/gitlab/git/blob_spec.rb b/spec/lib/gitlab/git/blob_spec.rb
index 7f680071969..1c24244c3a6 100644
--- a/spec/lib/gitlab/git/blob_spec.rb
+++ b/spec/lib/gitlab/git/blob_spec.rb
@@ -1,3 +1,5 @@
+# encoding: utf-8
+
require "spec_helper"
describe Gitlab::Git::Blob, :seed_helper do
diff --git a/spec/lib/gitlab/git/conflict/file_spec.rb b/spec/lib/gitlab/git/conflict/file_spec.rb
index a6cabd4966a..afed6c32af6 100644
--- a/spec/lib/gitlab/git/conflict/file_spec.rb
+++ b/spec/lib/gitlab/git/conflict/file_spec.rb
@@ -1,3 +1,4 @@
+# coding: utf-8
require 'spec_helper'
describe Gitlab::Git::Conflict::File do
diff --git a/spec/lib/gitlab/git/repository_spec.rb b/spec/lib/gitlab/git/repository_spec.rb
index e455c4c99ab..dccd50bc472 100644
--- a/spec/lib/gitlab/git/repository_spec.rb
+++ b/spec/lib/gitlab/git/repository_spec.rb
@@ -1,3 +1,4 @@
+# coding: utf-8
require "spec_helper"
describe Gitlab::Git::Repository, :seed_helper do
diff --git a/spec/lib/gitlab/git_spec.rb b/spec/lib/gitlab/git_spec.rb
index 505bc470644..6515be85ae3 100644
--- a/spec/lib/gitlab/git_spec.rb
+++ b/spec/lib/gitlab/git_spec.rb
@@ -1,3 +1,4 @@
+# coding: utf-8
require 'spec_helper'
describe Gitlab::Git do
diff --git a/spec/lib/gitlab/hook_data/issuable_builder_spec.rb b/spec/lib/gitlab/hook_data/issuable_builder_spec.rb
index 97a89b319ea..569d5dcc757 100644
--- a/spec/lib/gitlab/hook_data/issuable_builder_spec.rb
+++ b/spec/lib/gitlab/hook_data/issuable_builder_spec.rb
@@ -42,15 +42,7 @@ describe Gitlab::HookData::IssuableBuilder do
[{ id: 1, title: 'foo' }],
[{ id: 1, title: 'foo' }, { id: 2, title: 'bar' }]
],
- total_time_spent: [1, 2],
- assignees: [
- [],
- [{
- name: "Foo Bar",
- username: "foobar",
- avatar_url: "http://www.example.com/my-avatar.jpg"
- }]
- ]
+ total_time_spent: [1, 2]
}
end
let(:data) { builder.build(user: user, changes: changes) }
@@ -66,14 +58,6 @@ describe Gitlab::HookData::IssuableBuilder do
total_time_spent: {
previous: 1,
current: 2
- },
- assignees: {
- previous: [],
- current: [{
- name: "Foo Bar",
- username: "foobar",
- avatar_url: "http://www.example.com/my-avatar.jpg"
- }]
}
}))
end
diff --git a/spec/lib/gitlab/import_export/all_models.yml b/spec/lib/gitlab/import_export/all_models.yml
index d3be1e86539..6d573a4f39a 100644
--- a/spec/lib/gitlab/import_export/all_models.yml
+++ b/spec/lib/gitlab/import_export/all_models.yml
@@ -65,8 +65,8 @@ milestone:
- participants
- events
- boards
-- milestone_releases
-- releases
+- milestone_release
+- release
snippets:
- author
- project
@@ -77,8 +77,8 @@ releases:
- author
- project
- links
-- milestone_releases
-- milestones
+- milestone_release
+- milestone
links:
- release
project_members:
diff --git a/spec/lib/gitlab/json_logger_spec.rb b/spec/lib/gitlab/json_logger_spec.rb
index 3d4f9b5db86..d3d9fe9948a 100644
--- a/spec/lib/gitlab/json_logger_spec.rb
+++ b/spec/lib/gitlab/json_logger_spec.rb
@@ -1,3 +1,4 @@
+# coding: utf-8
require 'spec_helper'
describe Gitlab::JsonLogger do
diff --git a/spec/lib/gitlab/path_regex_spec.rb b/spec/lib/gitlab/path_regex_spec.rb
index 0829a2b4334..7dcdad7ff92 100644
--- a/spec/lib/gitlab/path_regex_spec.rb
+++ b/spec/lib/gitlab/path_regex_spec.rb
@@ -1,3 +1,4 @@
+# coding: utf-8
# frozen_string_literal: true
require 'spec_helper'
diff --git a/spec/lib/gitlab/popen_spec.rb b/spec/lib/gitlab/popen_spec.rb
index b398381a7e0..29afd9df74e 100644
--- a/spec/lib/gitlab/popen_spec.rb
+++ b/spec/lib/gitlab/popen_spec.rb
@@ -87,12 +87,4 @@ describe Gitlab::Popen do
it { expect(@status).to be_zero }
it { expect(@output).to eq('hello') }
end
-
- context 'when binary is absent' do
- it 'raises error' do
- expect do
- @klass.new.popen(%w[foobar])
- end.to raise_error
- end
- end
end
diff --git a/spec/lib/gitlab/project_search_results_spec.rb b/spec/lib/gitlab/project_search_results_spec.rb
index d6e50c672e6..e0b9581c75c 100644
--- a/spec/lib/gitlab/project_search_results_spec.rb
+++ b/spec/lib/gitlab/project_search_results_spec.rb
@@ -1,3 +1,4 @@
+# coding: utf-8
# frozen_string_literal: true
require 'spec_helper'
diff --git a/spec/lib/gitlab/regex_spec.rb b/spec/lib/gitlab/regex_spec.rb
index 3036e3a9754..e19210d8fbf 100644
--- a/spec/lib/gitlab/regex_spec.rb
+++ b/spec/lib/gitlab/regex_spec.rb
@@ -1,3 +1,4 @@
+# coding: utf-8
# frozen_string_literal: true
require 'spec_helper'
diff --git a/spec/lib/gitlab/search/found_blob_spec.rb b/spec/lib/gitlab/search/found_blob_spec.rb
index a575f6e2f11..3496fb29836 100644
--- a/spec/lib/gitlab/search/found_blob_spec.rb
+++ b/spec/lib/gitlab/search/found_blob_spec.rb
@@ -1,3 +1,4 @@
+# coding: utf-8
# frozen_string_literal: true
require 'spec_helper'
diff --git a/spec/lib/gitlab/url_blocker_spec.rb b/spec/lib/gitlab/url_blocker_spec.rb
index 0e66e959b24..6ce002ad70e 100644
--- a/spec/lib/gitlab/url_blocker_spec.rb
+++ b/spec/lib/gitlab/url_blocker_spec.rb
@@ -1,3 +1,4 @@
+# coding: utf-8
# frozen_string_literal: true
require 'spec_helper'
diff --git a/spec/lib/gitlab/usage_data_spec.rb b/spec/lib/gitlab/usage_data_spec.rb
index 62787c5abaf..8eb64b97d6a 100644
--- a/spec/lib/gitlab/usage_data_spec.rb
+++ b/spec/lib/gitlab/usage_data_spec.rb
@@ -3,16 +3,14 @@
require 'spec_helper'
describe Gitlab::UsageData do
- let(:projects) { create_list(:project, 4) }
+ let(:projects) { create_list(:project, 3) }
let!(:board) { create(:board, project: projects[0]) }
describe '#data' do
before do
create(:jira_service, project: projects[0])
- create(:jira_service, :without_properties_callback, project: projects[1])
+ create(:jira_service, project: projects[1])
create(:jira_service, :jira_cloud_service, project: projects[2])
- create(:jira_service, :without_properties_callback, project: projects[3],
- properties: { url: 'https://mysite.atlassian.net' })
create(:prometheus_service, project: projects[1])
create(:service, project: projects[0], type: 'SlackSlashCommandsService', active: true)
create(:service, project: projects[1], type: 'SlackService', active: true)
@@ -158,7 +156,7 @@ describe Gitlab::UsageData do
count_data = subject[:counts]
expect(count_data[:boards]).to eq(1)
- expect(count_data[:projects]).to eq(4)
+ expect(count_data[:projects]).to eq(3)
expect(count_data.keys).to include(*expected_keys)
expect(expected_keys - count_data.keys).to be_empty
end
@@ -166,14 +164,14 @@ describe Gitlab::UsageData do
it 'gathers projects data correctly' do
count_data = subject[:counts]
- expect(count_data[:projects]).to eq(4)
+ expect(count_data[:projects]).to eq(3)
expect(count_data[:projects_prometheus_active]).to eq(1)
- expect(count_data[:projects_jira_active]).to eq(4)
+ expect(count_data[:projects_jira_active]).to eq(3)
expect(count_data[:projects_jira_server_active]).to eq(2)
- expect(count_data[:projects_jira_cloud_active]).to eq(2)
+ expect(count_data[:projects_jira_cloud_active]).to eq(1)
expect(count_data[:projects_slack_notifications_active]).to eq(2)
expect(count_data[:projects_slack_slash_active]).to eq(1)
- expect(count_data[:projects_with_repositories_enabled]).to eq(3)
+ expect(count_data[:projects_with_repositories_enabled]).to eq(2)
expect(count_data[:projects_with_error_tracking_enabled]).to eq(1)
expect(count_data[:clusters_enabled]).to eq(7)
diff --git a/spec/lib/gitlab_danger_spec.rb b/spec/lib/gitlab_danger_spec.rb
index 26bf5d76756..623ac20fa7c 100644
--- a/spec/lib/gitlab_danger_spec.rb
+++ b/spec/lib/gitlab_danger_spec.rb
@@ -9,7 +9,7 @@ describe GitlabDanger do
describe '.local_warning_message' do
it 'returns an informational message with rules that can run' do
- expect(described_class.local_warning_message).to eq('==> Only the following Danger rules can be run locally: changes_size, gemfile, documentation, frozen_string, duplicate_yarn_dependencies, prettier, eslint, database, commit_messages')
+ expect(described_class.local_warning_message).to eq('==> Only the following Danger rules can be run locally: changes_size, gemfile, documentation, frozen_string, duplicate_yarn_dependencies, prettier, eslint, database')
end
end