diff --git a/spec/lib/gitlab/git/blob_snippet_spec.rb b/spec/lib/gitlab/git/blob_snippet_spec.rb index 17d6be470aca5635eeb898c4414d96707ab81a86..d6d365f64923967f24258f3a9163f52e554cd13e 100644 --- a/spec/lib/gitlab/git/blob_snippet_spec.rb +++ b/spec/lib/gitlab/git/blob_snippet_spec.rb @@ -3,7 +3,7 @@ require "spec_helper" describe Gitlab::Git::BlobSnippet, seed_helper: true do - describe :data do + describe '#data' do context 'empty lines' do let(:snippet) { Gitlab::Git::BlobSnippet.new('master', nil, nil, nil) } diff --git a/spec/lib/gitlab/git/blob_spec.rb b/spec/lib/gitlab/git/blob_spec.rb index 8049e2c120d6743755c10e3fc108c10da2790870..b883526151e3caf67500863df1139677dc9fbfc8 100644 --- a/spec/lib/gitlab/git/blob_spec.rb +++ b/spec/lib/gitlab/git/blob_spec.rb @@ -5,7 +5,7 @@ require "spec_helper" describe Gitlab::Git::Blob, seed_helper: true do let(:repository) { Gitlab::Git::Repository.new(TEST_REPO_PATH) } - describe :initialize do + describe 'initialize' do let(:blob) { Gitlab::Git::Blob.new(name: 'test') } it 'handles nil data' do @@ -15,7 +15,7 @@ describe Gitlab::Git::Blob, seed_helper: true do end end - describe :find do + describe '.find' do context 'file in subdir' do let(:blob) { Gitlab::Git::Blob.find(repository, SeedRepo::Commit::ID, "files/ruby/popen.rb") } @@ -101,7 +101,7 @@ describe Gitlab::Git::Blob, seed_helper: true do end end - describe :raw do + describe '.raw' do let(:raw_blob) { Gitlab::Git::Blob.raw(repository, SeedRepo::RubyBlob::ID) } it { expect(raw_blob.id).to eq(SeedRepo::RubyBlob::ID) } it { expect(raw_blob.data[0..10]).to eq("require \'fi") } @@ -222,7 +222,7 @@ describe Gitlab::Git::Blob, seed_helper: true do end end - describe :lfs_pointers do + describe 'lfs_pointers' do context 'file a valid lfs pointer' do let(:blob) do Gitlab::Git::Blob.find( diff --git a/spec/lib/gitlab/git/commit_spec.rb b/spec/lib/gitlab/git/commit_spec.rb index e1be6784c202a3429676cfef641275959d512d5b..5cf4631fbfcc6ad9603c0946a029242176f1fe8c 100644 --- a/spec/lib/gitlab/git/commit_spec.rb +++ b/spec/lib/gitlab/git/commit_spec.rb @@ -65,7 +65,7 @@ describe Gitlab::Git::Commit, seed_helper: true do end context 'Class methods' do - describe :find do + describe '.find' do it "should return first head commit if without params" do expect(Gitlab::Git::Commit.last(repository).id).to eq( repository.raw.head.target.oid @@ -103,7 +103,7 @@ describe Gitlab::Git::Commit, seed_helper: true do end end - describe :last_for_path do + describe '.last_for_path' do context 'no path' do subject { Gitlab::Git::Commit.last_for_path(repository, 'master') } @@ -132,7 +132,7 @@ describe Gitlab::Git::Commit, seed_helper: true do end end - describe "where" do + describe '.where' do context 'path is empty string' do subject do commits = Gitlab::Git::Commit.where( @@ -230,7 +230,7 @@ describe Gitlab::Git::Commit, seed_helper: true do end end - describe :between do + describe '.between' do subject do commits = Gitlab::Git::Commit.between(repository, SeedRepo::Commit::PARENT_ID, SeedRepo::Commit::ID) commits.map { |c| c.id } @@ -243,7 +243,7 @@ describe Gitlab::Git::Commit, seed_helper: true do it { is_expected.not_to include(SeedRepo::FirstCommit::ID) } end - describe :find_all do + describe '.find_all' do context 'max_count' do subject do commits = Gitlab::Git::Commit.find_all( @@ -304,7 +304,7 @@ describe Gitlab::Git::Commit, seed_helper: true do end end - describe :init_from_rugged do + describe '#init_from_rugged' do let(:gitlab_commit) { Gitlab::Git::Commit.new(rugged_commit) } subject { gitlab_commit } @@ -314,7 +314,7 @@ describe Gitlab::Git::Commit, seed_helper: true do end end - describe :init_from_hash do + describe '#init_from_hash' do let(:commit) { Gitlab::Git::Commit.new(sample_commit_hash) } subject { commit } @@ -329,7 +329,7 @@ describe Gitlab::Git::Commit, seed_helper: true do end end - describe :stats do + describe '#stats' do subject { commit.stats } describe '#additions' do @@ -343,25 +343,25 @@ describe Gitlab::Git::Commit, seed_helper: true do end end - describe :to_diff do + describe '#to_diff' do subject { commit.to_diff } it { is_expected.not_to include "From #{SeedRepo::Commit::ID}" } it { is_expected.to include 'diff --git a/files/ruby/popen.rb b/files/ruby/popen.rb'} end - describe :has_zero_stats? do + describe '#has_zero_stats?' do it { expect(commit.has_zero_stats?).to eq(false) } end - describe :to_patch do + describe '#to_patch' do subject { commit.to_patch } it { is_expected.to include "From #{SeedRepo::Commit::ID}" } it { is_expected.to include 'diff --git a/files/ruby/popen.rb b/files/ruby/popen.rb'} end - describe :to_hash do + describe '#to_hash' do let(:hash) { commit.to_hash } subject { hash } @@ -373,7 +373,7 @@ describe Gitlab::Git::Commit, seed_helper: true do end end - describe :diffs do + describe '#diffs' do subject { commit.diffs } it { is_expected.to be_kind_of Gitlab::Git::DiffCollection } @@ -381,7 +381,7 @@ describe Gitlab::Git::Commit, seed_helper: true do it { expect(subject.first).to be_kind_of Gitlab::Git::Diff } end - describe :ref_names do + describe '#ref_names' do let(:commit) { Gitlab::Git::Commit.find(repository, 'master') } subject { commit.ref_names(repository) } diff --git a/spec/lib/gitlab/git/compare_spec.rb b/spec/lib/gitlab/git/compare_spec.rb index f66b68e42186354b00a94dae10ac1fa9e6c145b3..e28debe1494289ae30d0e391b51c8ab9880bed4d 100644 --- a/spec/lib/gitlab/git/compare_spec.rb +++ b/spec/lib/gitlab/git/compare_spec.rb @@ -5,7 +5,7 @@ describe Gitlab::Git::Compare, seed_helper: true do let(:compare) { Gitlab::Git::Compare.new(repository, SeedRepo::BigCommit::ID, SeedRepo::Commit::ID, false) } let(:compare_straight) { Gitlab::Git::Compare.new(repository, SeedRepo::BigCommit::ID, SeedRepo::Commit::ID, true) } - describe :commits do + describe '#commits' do subject do compare.commits.map(&:id) end @@ -42,7 +42,7 @@ describe Gitlab::Git::Compare, seed_helper: true do end end - describe :diffs do + describe '#diffs' do subject do compare.diffs.map(&:new_path) end @@ -67,7 +67,7 @@ describe Gitlab::Git::Compare, seed_helper: true do end end - describe :same do + describe '#same' do subject do compare.same end @@ -81,7 +81,7 @@ describe Gitlab::Git::Compare, seed_helper: true do end end - describe :commits_straight do + describe '#commits', 'straight compare' do subject do compare_straight.commits.map(&:id) end @@ -94,7 +94,7 @@ describe Gitlab::Git::Compare, seed_helper: true do it { is_expected.not_to include(SeedRepo::BigCommit::PARENT_ID) } end - describe :diffs_straight do + describe '#diffs', 'straight compare' do subject do compare_straight.diffs.map(&:new_path) end diff --git a/spec/lib/gitlab/git/diff_collection_spec.rb b/spec/lib/gitlab/git/diff_collection_spec.rb index 47bdd7310d5c79c0d07af6b989c745e3f54f20b1..122c93dcd690bb146063eb1621abe478bbaae6c5 100644 --- a/spec/lib/gitlab/git/diff_collection_spec.rb +++ b/spec/lib/gitlab/git/diff_collection_spec.rb @@ -24,7 +24,7 @@ describe Gitlab::Git::DiffCollection, seed_helper: true do it { is_expected.to be_kind_of ::Array } end - describe :decorate! do + describe '#decorate!' do let(:file_count) { 3 } it 'modifies the array in place' do @@ -302,7 +302,7 @@ describe Gitlab::Git::DiffCollection, seed_helper: true do end end - describe :each do + describe '#each' do context 'when diff are too large' do let(:collection) do Gitlab::Git::DiffCollection.new([{ diff: 'a' * 204800 }]) diff --git a/spec/lib/gitlab/git/tree_spec.rb b/spec/lib/gitlab/git/tree_spec.rb index 688e2a753732b37a2845bf3c5ca0c526d18dd137..83d2ff8f9b3f4c2008a3cfe90ad968c9bb98e439 100644 --- a/spec/lib/gitlab/git/tree_spec.rb +++ b/spec/lib/gitlab/git/tree_spec.rb @@ -11,7 +11,7 @@ describe Gitlab::Git::Tree, seed_helper: true do it { expect(tree.select(&:file?).size).to eq(10) } it { expect(tree.select(&:submodule?).size).to eq(2) } - describe :dir do + describe '#dir?' do let(:dir) { tree.select(&:dir?).first } it { expect(dir).to be_kind_of Gitlab::Git::Tree } @@ -41,7 +41,7 @@ describe Gitlab::Git::Tree, seed_helper: true do end end - describe :file do + describe '#file?' do let(:file) { tree.select(&:file?).first } it { expect(file).to be_kind_of Gitlab::Git::Tree } @@ -50,21 +50,21 @@ describe Gitlab::Git::Tree, seed_helper: true do it { expect(file.name).to eq('.gitignore') } end - describe :readme do + describe '#readme?' do let(:file) { tree.select(&:readme?).first } it { expect(file).to be_kind_of Gitlab::Git::Tree } it { expect(file.name).to eq('README.md') } end - describe :contributing do + describe '#contributing?' do let(:file) { tree.select(&:contributing?).first } it { expect(file).to be_kind_of Gitlab::Git::Tree } it { expect(file.name).to eq('CONTRIBUTING.md') } end - describe :submodule do + describe '#submodule?' do let(:submodule) { tree.select(&:submodule?).first } it { expect(submodule).to be_kind_of Gitlab::Git::Tree } diff --git a/spec/lib/gitlab/git/util_spec.rb b/spec/lib/gitlab/git/util_spec.rb index 8d43b570e98841c65ffc9cd1be694dcd72312a31..bcca4d4c746f5d1fdad1e635ea6654afcb576898 100644 --- a/spec/lib/gitlab/git/util_spec.rb +++ b/spec/lib/gitlab/git/util_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe Gitlab::Git::Util do - describe :count_lines do + describe '#count_lines' do [ ["", 0], ["foo", 1], diff --git a/spec/lib/gitlab/ldap/user_spec.rb b/spec/lib/gitlab/ldap/user_spec.rb index 2f3bd4393b7601932acc2692d81a996ab6e7f900..346cf0d117ccbc7026f77fbae9205885a140bac1 100644 --- a/spec/lib/gitlab/ldap/user_spec.rb +++ b/spec/lib/gitlab/ldap/user_spec.rb @@ -57,7 +57,7 @@ describe Gitlab::LDAP::User, lib: true do end end - describe :find_or_create do + describe 'find or create' do it "finds the user if already existing" do create(:omniauth_user, extern_uid: 'my-uid', provider: 'ldapmain') diff --git a/spec/models/milestone_spec.rb b/spec/models/milestone_spec.rb index 3cee2b7714f29b88371e1cb50c24c9239f3d4163..f3f48f951a89bc258039e046e880f0de6fc0a72a 100644 --- a/spec/models/milestone_spec.rb +++ b/spec/models/milestone_spec.rb @@ -109,7 +109,7 @@ describe Milestone, models: true do it { expect(milestone.percent_complete(user)).to eq(75) } end - describe :items_count do + describe '#is_empty?' do before do milestone.issues << create(:issue, project: project) milestone.issues << create(:closed_issue, project: project) diff --git a/spec/models/namespace_spec.rb b/spec/models/namespace_spec.rb index 67d48557184247d77ef8250effe08ed294a7339a..09aa6e9337ff1408d8348fc1ce022196f1f7dc27 100644 --- a/spec/models/namespace_spec.rb +++ b/spec/models/namespace_spec.rb @@ -163,7 +163,7 @@ describe Namespace, models: true do end end - describe :rm_dir do + describe '#rm_dir', 'callback' do let!(:project) { create(:empty_project, namespace: namespace) } let!(:path) { File.join(Gitlab.config.repositories.storages.default['path'], namespace.full_path) } diff --git a/spec/models/pages_domain_spec.rb b/spec/models/pages_domain_spec.rb index e6a4583a8fb0a5aa6830ab21a7cac26542d49cd5..c6c45d789902431c2938ed357ca1f7a823021e1e 100644 --- a/spec/models/pages_domain_spec.rb +++ b/spec/models/pages_domain_spec.rb @@ -5,7 +5,7 @@ describe PagesDomain, models: true do it { is_expected.to belong_to(:project) } end - describe :validate_domain do + describe 'validate domain' do subject { build(:pages_domain, domain: domain) } context 'is unique' do @@ -75,7 +75,7 @@ describe PagesDomain, models: true do end end - describe :url do + describe '#url' do subject { domain.url } context 'without the certificate' do @@ -91,7 +91,7 @@ describe PagesDomain, models: true do end end - describe :has_matching_key? do + describe '#has_matching_key?' do subject { domain.has_matching_key? } context 'for matching key' do @@ -107,7 +107,7 @@ describe PagesDomain, models: true do end end - describe :has_intermediates? do + describe '#has_intermediates?' do subject { domain.has_intermediates? } context 'for self signed' do @@ -133,7 +133,7 @@ describe PagesDomain, models: true do end end - describe :expired? do + describe '#expired?' do subject { domain.expired? } context 'for valid' do @@ -149,7 +149,7 @@ describe PagesDomain, models: true do end end - describe :subject do + describe '#subject' do let(:domain) { build(:pages_domain, :with_certificate) } subject { domain.subject } @@ -157,7 +157,7 @@ describe PagesDomain, models: true do it { is_expected.to eq('/CN=test-certificate') } end - describe :certificate_text do + describe '#certificate_text' do let(:domain) { build(:pages_domain, :with_certificate) } subject { domain.certificate_text } diff --git a/spec/models/repository_spec.rb b/spec/models/repository_spec.rb index 274e4f00a0ae7095e45e2bbf3dd033bfcb93ade9..585b87b828d55ec3efed67e33e5115b763c2c5bf 100644 --- a/spec/models/repository_spec.rb +++ b/spec/models/repository_spec.rb @@ -1083,7 +1083,7 @@ describe Repository, models: true do end end - describe :skip_merged_commit do + describe 'skip_merges option' do subject { repository.commits(Gitlab::Git::BRANCH_REF_PREFIX + "'test'", limit: 100, skip_merges: true).map{ |k| k.id } } it { is_expected.not_to include('e56497bb5f03a90a51293fc6d516788730953899') } diff --git a/spec/requests/api/projects_spec.rb b/spec/requests/api/projects_spec.rb index c481b7e72b1e031fab5b69664a7ac3621a1bccba..a3de4702ad0d977208d41869fe7a84b9e04673e6 100644 --- a/spec/requests/api/projects_spec.rb +++ b/spec/requests/api/projects_spec.rb @@ -902,7 +902,7 @@ describe API::Projects, :api do end end - describe :fork_admin do + describe 'fork management' do let(:project_fork_target) { create(:empty_project) } let(:project_fork_source) { create(:empty_project, :public) } diff --git a/spec/requests/api/v3/projects_spec.rb b/spec/requests/api/v3/projects_spec.rb index d8bb562587d30096f0d51899fe4ea76dd2cceeef..b1aa793ec00ed8d2919f1b3d3d8226aa1e35eb78 100644 --- a/spec/requests/api/v3/projects_spec.rb +++ b/spec/requests/api/v3/projects_spec.rb @@ -949,7 +949,7 @@ describe API::V3::Projects, api: true do end end - describe :fork_admin do + describe 'fork management' do let(:project_fork_target) { create(:empty_project) } let(:project_fork_source) { create(:empty_project, :public) } diff --git a/spec/services/milestones/close_service_spec.rb b/spec/services/milestones/close_service_spec.rb index 92b84308f73580c4fbc0c6419c0a4b2c8881ac5c..fe6a19e97eafd2a8b3a7a3e715bb6b2a4f9e044e 100644 --- a/spec/services/milestones/close_service_spec.rb +++ b/spec/services/milestones/close_service_spec.rb @@ -17,7 +17,7 @@ describe Milestones::CloseService, services: true do it { expect(milestone).to be_valid } it { expect(milestone).to be_closed } - describe :event do + describe 'event' do let(:event) { Event.recent.first } it { expect(event.milestone).to be_truthy } diff --git a/spec/services/projects/fork_service_spec.rb b/spec/services/projects/fork_service_spec.rb index 8e6142111163080d8a7254a843dfe7ff7d5479b4..e3be1989c93cbbdb7ee497160da8b454c8ce56f8 100644 --- a/spec/services/projects/fork_service_spec.rb +++ b/spec/services/projects/fork_service_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe Projects::ForkService, services: true do - describe :fork_by_user do + describe 'fork by user' do before do @from_namespace = create(:namespace) @from_user = create(:user, namespace: @from_namespace ) @@ -100,7 +100,7 @@ describe Projects::ForkService, services: true do end end - describe :fork_to_namespace do + describe 'fork to namespace' do before do @group_owner = create(:user) @developer = create(:user)