Commit adc6ec4a authored by Robert Speicher's avatar Robert Speicher

Avoid `describe`-ing symbols in specs

parent 158786ca
...@@ -11,7 +11,7 @@ describe NotesFinder do ...@@ -11,7 +11,7 @@ describe NotesFinder do
project.team << [user, :master] project.team << [user, :master]
end end
describe :execute do describe '#execute' do
let(:params) { { target_id: commit.id, target_type: 'commit', last_fetched_at: 1.hour.ago.to_i } } let(:params) { { target_id: commit.id, target_type: 'commit', last_fetched_at: 1.hour.ago.to_i } }
before do before do
......
...@@ -31,7 +31,7 @@ module Ci ...@@ -31,7 +31,7 @@ module Ci
}) })
end end
describe :only do describe 'only' do
it "does not return builds if only has another branch" do it "does not return builds if only has another branch" do
config = YAML.dump({ config = YAML.dump({
before_script: ["pwd"], before_script: ["pwd"],
...@@ -187,7 +187,7 @@ module Ci ...@@ -187,7 +187,7 @@ module Ci
end end
end end
describe :except do describe 'except' do
it "returns builds if except has another branch" do it "returns builds if except has another branch" do
config = YAML.dump({ config = YAML.dump({
before_script: ["pwd"], before_script: ["pwd"],
......
...@@ -3,7 +3,7 @@ require 'spec_helper' ...@@ -3,7 +3,7 @@ require 'spec_helper'
describe 'Gitlab::BuildDataBuilder' do describe 'Gitlab::BuildDataBuilder' do
let(:build) { create(:ci_build) } let(:build) { create(:ci_build) }
describe :build do describe '.build' do
let(:data) do let(:data) do
Gitlab::BuildDataBuilder.build(build) Gitlab::BuildDataBuilder.build(build)
end end
......
...@@ -8,14 +8,14 @@ describe Gitlab::Diff::File, lib: true do ...@@ -8,14 +8,14 @@ describe Gitlab::Diff::File, lib: true do
let(:diff) { commit.diffs.first } let(:diff) { commit.diffs.first }
let(:diff_file) { Gitlab::Diff::File.new(diff, diff_refs: commit.diff_refs, repository: project.repository) } let(:diff_file) { Gitlab::Diff::File.new(diff, diff_refs: commit.diff_refs, repository: project.repository) }
describe :diff_lines do describe '#diff_lines' do
let(:diff_lines) { diff_file.diff_lines } let(:diff_lines) { diff_file.diff_lines }
it { expect(diff_lines.size).to eq(30) } it { expect(diff_lines.size).to eq(30) }
it { expect(diff_lines.first).to be_kind_of(Gitlab::Diff::Line) } it { expect(diff_lines.first).to be_kind_of(Gitlab::Diff::Line) }
end end
describe :mode_changed? do describe '#mode_changed?' do
it { expect(diff_file.mode_changed?).to be_falsey } it { expect(diff_file.mode_changed?).to be_falsey }
end end
......
...@@ -8,7 +8,7 @@ describe Gitlab::Diff::Parser, lib: true do ...@@ -8,7 +8,7 @@ describe Gitlab::Diff::Parser, lib: true do
let(:diff) { commit.diffs.first } let(:diff) { commit.diffs.first }
let(:parser) { Gitlab::Diff::Parser.new } let(:parser) { Gitlab::Diff::Parser.new }
describe :parse do describe '#parse' do
let(:diff) do let(:diff) do
<<eos <<eos
--- a/files/ruby/popen.rb --- a/files/ruby/popen.rb
......
...@@ -4,7 +4,7 @@ describe Gitlab::LDAP::Access, lib: true do ...@@ -4,7 +4,7 @@ describe Gitlab::LDAP::Access, lib: true do
let(:access) { Gitlab::LDAP::Access.new user } let(:access) { Gitlab::LDAP::Access.new user }
let(:user) { create(:omniauth_user) } let(:user) { create(:omniauth_user) }
describe :allowed? do describe '#allowed?' do
subject { access.allowed? } subject { access.allowed? }
context 'when the user cannot be found' do context 'when the user cannot be found' do
......
...@@ -25,7 +25,7 @@ describe Gitlab::LDAP::User, lib: true do ...@@ -25,7 +25,7 @@ describe Gitlab::LDAP::User, lib: true do
OmniAuth::AuthHash.new(uid: 'my-uid', provider: 'ldapmain', info: info_upper_case) OmniAuth::AuthHash.new(uid: 'my-uid', provider: 'ldapmain', info: info_upper_case)
end end
describe :changed? do describe '#changed?' do
it "marks existing ldap user as changed" do it "marks existing ldap user as changed" do
create(:omniauth_user, extern_uid: 'my-uid', provider: 'ldapmain') create(:omniauth_user, extern_uid: 'my-uid', provider: 'ldapmain')
expect(ldap_user.changed?).to be_truthy expect(ldap_user.changed?).to be_truthy
......
...@@ -15,7 +15,7 @@ describe Ci::Pipeline, models: true do ...@@ -15,7 +15,7 @@ describe Ci::Pipeline, models: true do
it { is_expected.to respond_to :git_author_email } it { is_expected.to respond_to :git_author_email }
it { is_expected.to respond_to :short_sha } it { is_expected.to respond_to :short_sha }
describe :valid_commit_sha do describe '#valid_commit_sha' do
context 'commit.sha can not start with 00000000' do context 'commit.sha can not start with 00000000' do
before do before do
pipeline.sha = '0' * 40 pipeline.sha = '0' * 40
...@@ -26,7 +26,7 @@ describe Ci::Pipeline, models: true do ...@@ -26,7 +26,7 @@ describe Ci::Pipeline, models: true do
end end
end end
describe :short_sha do describe '#short_sha' do
subject { pipeline.short_sha } subject { pipeline.short_sha }
it 'has 8 items' do it 'has 8 items' do
...@@ -35,10 +35,10 @@ describe Ci::Pipeline, models: true do ...@@ -35,10 +35,10 @@ describe Ci::Pipeline, models: true do
it { expect(pipeline.sha).to start_with(subject) } it { expect(pipeline.sha).to start_with(subject) }
end end
describe :create_next_builds do describe '#create_next_builds' do
end end
describe :retried do describe '#retried' do
subject { pipeline.retried } subject { pipeline.retried }
before do before do
...@@ -51,7 +51,7 @@ describe Ci::Pipeline, models: true do ...@@ -51,7 +51,7 @@ describe Ci::Pipeline, models: true do
end end
end end
describe :create_builds do describe '#create_builds' do
let!(:pipeline) { FactoryGirl.create :ci_pipeline, project: project, ref: 'master', tag: false } let!(:pipeline) { FactoryGirl.create :ci_pipeline, project: project, ref: 'master', tag: false }
def create_builds(trigger_request = nil) def create_builds(trigger_request = nil)
......
...@@ -9,7 +9,7 @@ describe Ci::Variable, models: true do ...@@ -9,7 +9,7 @@ describe Ci::Variable, models: true do
subject.value = secret_value subject.value = secret_value
end end
describe :value do describe '#value' do
it 'stores the encrypted value' do it 'stores the encrypted value' do
expect(subject.encrypted_value).not_to be_nil expect(subject.encrypted_value).not_to be_nil
end end
......
...@@ -24,14 +24,14 @@ describe CommitStatus, models: true do ...@@ -24,14 +24,14 @@ describe CommitStatus, models: true do
it { is_expected.to respond_to :running? } it { is_expected.to respond_to :running? }
it { is_expected.to respond_to :pending? } it { is_expected.to respond_to :pending? }
describe :author do describe '#author' do
subject { commit_status.author } subject { commit_status.author }
before { commit_status.author = User.new } before { commit_status.author = User.new }
it { is_expected.to eq(commit_status.user) } it { is_expected.to eq(commit_status.user) }
end end
describe :started? do describe '#started?' do
subject { commit_status.started? } subject { commit_status.started? }
context 'without started_at' do context 'without started_at' do
...@@ -57,7 +57,7 @@ describe CommitStatus, models: true do ...@@ -57,7 +57,7 @@ describe CommitStatus, models: true do
end end
end end
describe :active? do describe '#active?' do
subject { commit_status.active? } subject { commit_status.active? }
%w(pending running).each do |state| %w(pending running).each do |state|
...@@ -77,7 +77,7 @@ describe CommitStatus, models: true do ...@@ -77,7 +77,7 @@ describe CommitStatus, models: true do
end end
end end
describe :complete? do describe '#complete?' do
subject { commit_status.complete? } subject { commit_status.complete? }
%w(success failed canceled).each do |state| %w(success failed canceled).each do |state|
...@@ -97,7 +97,7 @@ describe CommitStatus, models: true do ...@@ -97,7 +97,7 @@ describe CommitStatus, models: true do
end end
end end
describe :duration do describe '#duration' do
subject { commit_status.duration } subject { commit_status.duration }
it { is_expected.to eq(120.0) } it { is_expected.to eq(120.0) }
...@@ -122,7 +122,7 @@ describe CommitStatus, models: true do ...@@ -122,7 +122,7 @@ describe CommitStatus, models: true do
end end
end end
describe :latest do describe '.latest' do
subject { CommitStatus.latest.order(:id) } subject { CommitStatus.latest.order(:id) }
before do before do
...@@ -138,7 +138,7 @@ describe CommitStatus, models: true do ...@@ -138,7 +138,7 @@ describe CommitStatus, models: true do
end end
end end
describe :running_or_pending do describe '.running_or_pending' do
subject { CommitStatus.running_or_pending.order(:id) } subject { CommitStatus.running_or_pending.order(:id) }
before do before do
......
...@@ -7,7 +7,7 @@ describe Mentionable do ...@@ -7,7 +7,7 @@ describe Mentionable do
nil nil
end end
describe :references do describe 'references' do
let(:project) { create(:project) } let(:project) { create(:project) }
it 'excludes JIRA references' do it 'excludes JIRA references' do
......
...@@ -18,7 +18,7 @@ describe ForkedProjectLink, "add link on fork" do ...@@ -18,7 +18,7 @@ describe ForkedProjectLink, "add link on fork" do
end end
end end
describe :forked_from_project do describe '#forked?' do
let(:forked_project_link) { build(:forked_project_link) } let(:forked_project_link) { build(:forked_project_link) }
let(:project_from) { create(:project) } let(:project_from) { create(:project) }
let(:project_to) { create(:project, forked_project_link: forked_project_link) } let(:project_to) { create(:project, forked_project_link: forked_project_link) }
......
...@@ -4,33 +4,33 @@ describe GenericCommitStatus, models: true do ...@@ -4,33 +4,33 @@ describe GenericCommitStatus, models: true do
let(:pipeline) { FactoryGirl.create :ci_pipeline } let(:pipeline) { FactoryGirl.create :ci_pipeline }
let(:generic_commit_status) { FactoryGirl.create :generic_commit_status, pipeline: pipeline } let(:generic_commit_status) { FactoryGirl.create :generic_commit_status, pipeline: pipeline }
describe :context do describe '#context' do
subject { generic_commit_status.context } subject { generic_commit_status.context }
before { generic_commit_status.context = 'my_context' } before { generic_commit_status.context = 'my_context' }
it { is_expected.to eq(generic_commit_status.name) } it { is_expected.to eq(generic_commit_status.name) }
end end
describe :tags do describe '#tags' do
subject { generic_commit_status.tags } subject { generic_commit_status.tags }
it { is_expected.to eq([:external]) } it { is_expected.to eq([:external]) }
end end
describe :set_default_values do describe 'set_default_values' do
before do before do
generic_commit_status.context = nil generic_commit_status.context = nil
generic_commit_status.stage = nil generic_commit_status.stage = nil
generic_commit_status.save generic_commit_status.save
end end
describe :context do describe '#context' do
subject { generic_commit_status.context } subject { generic_commit_status.context }
it { is_expected.not_to be_nil } it { is_expected.not_to be_nil }
end end
describe :stage do describe '#stage' do
subject { generic_commit_status.stage } subject { generic_commit_status.stage }
it { is_expected.not_to be_nil } it { is_expected.not_to be_nil }
......
...@@ -14,7 +14,7 @@ describe GlobalMilestone, models: true do ...@@ -14,7 +14,7 @@ describe GlobalMilestone, models: true do
let(:milestone2_project2) { create(:milestone, title: "VD-123", project: project2) } let(:milestone2_project2) { create(:milestone, title: "VD-123", project: project2) }
let(:milestone2_project3) { create(:milestone, title: "VD-123", project: project3) } let(:milestone2_project3) { create(:milestone, title: "VD-123", project: project3) }
describe :build_collection do describe '.build_collection' do
before do before do
milestones = milestones =
[ [
...@@ -42,7 +42,7 @@ describe GlobalMilestone, models: true do ...@@ -42,7 +42,7 @@ describe GlobalMilestone, models: true do
end end
end end
describe :initialize do describe '#initialize' do
before do before do
milestones = milestones =
[ [
...@@ -63,7 +63,7 @@ describe GlobalMilestone, models: true do ...@@ -63,7 +63,7 @@ describe GlobalMilestone, models: true do
end end
end end
describe :safe_title do describe '#safe_title' do
let(:milestone) { create(:milestone, title: "git / test", project: project1) } let(:milestone) { create(:milestone, title: "git / test", project: project1) }
it 'should strip out slashes and spaces' do it 'should strip out slashes and spaces' do
......
...@@ -97,22 +97,22 @@ describe Group, models: true do ...@@ -97,22 +97,22 @@ describe Group, models: true do
end end
end end
describe :users do describe '#users' do
it { expect(group.users).to eq(group.owners) } it { expect(group.users).to eq(group.owners) }
end end
describe :human_name do describe '#human_name' do
it { expect(group.human_name).to eq(group.name) } it { expect(group.human_name).to eq(group.name) }
end end
describe :add_users do describe '#add_user' do
let(:user) { create(:user) } let(:user) { create(:user) }
before { group.add_user(user, GroupMember::MASTER) } before { group.add_user(user, GroupMember::MASTER) }
it { expect(group.group_members.masters.map(&:user)).to include(user) } it { expect(group.group_members.masters.map(&:user)).to include(user) }
end end
describe :add_users do describe '#add_users' do
let(:user) { create(:user) } let(:user) { create(:user) }
before { group.add_users([user.id], GroupMember::GUEST) } before { group.add_users([user.id], GroupMember::GUEST) }
...@@ -124,7 +124,7 @@ describe Group, models: true do ...@@ -124,7 +124,7 @@ describe Group, models: true do
end end
end end
describe :avatar_type do describe '#avatar_type' do
let(:user) { create(:user) } let(:user) { create(:user) }
before { group.add_user(user, GroupMember::MASTER) } before { group.add_user(user, GroupMember::MASTER) }
......
...@@ -101,7 +101,7 @@ describe ProjectMember, models: true do ...@@ -101,7 +101,7 @@ describe ProjectMember, models: true do
end end
end end
describe :add_users_into_projects do describe '.add_users_into_projects' do
before do before do
@project_1 = create :project @project_1 = create :project
@project_2 = create :project @project_2 = create :project
...@@ -123,7 +123,7 @@ describe ProjectMember, models: true do ...@@ -123,7 +123,7 @@ describe ProjectMember, models: true do
it { expect(@project_2.users).to include(@user_2) } it { expect(@project_2.users).to include(@user_2) }
end end
describe :truncate_teams do describe '.truncate_teams' do
before do before do
@project_1 = create :project @project_1 = create :project
@project_2 = create :project @project_2 = create :project
......
...@@ -70,7 +70,7 @@ describe Milestone, models: true do ...@@ -70,7 +70,7 @@ describe Milestone, models: true do
end end
end end
describe :expired? do describe '#expired?' do
context "expired" do context "expired" do
before do before do
allow(milestone).to receive(:due_date).and_return(Date.today.prev_year) allow(milestone).to receive(:due_date).and_return(Date.today.prev_year)
...@@ -88,7 +88,7 @@ describe Milestone, models: true do ...@@ -88,7 +88,7 @@ describe Milestone, models: true do
end end
end end
describe :percent_complete do describe '#percent_complete' do
before do before do
allow(milestone).to receive_messages( allow(milestone).to receive_messages(
closed_items_count: 3, closed_items_count: 3,
...@@ -111,11 +111,11 @@ describe Milestone, models: true do ...@@ -111,11 +111,11 @@ describe Milestone, models: true do
it { expect(milestone.is_empty?(user)).to be_falsey } it { expect(milestone.is_empty?(user)).to be_falsey }
end end
describe :can_be_closed? do describe '#can_be_closed?' do
it { expect(milestone.can_be_closed?).to be_truthy } it { expect(milestone.can_be_closed?).to be_truthy }
end end
describe :total_items_count do describe '#total_items_count' do
before do before do
create :closed_issue, milestone: milestone create :closed_issue, milestone: milestone
create :merge_request, milestone: milestone create :merge_request, milestone: milestone
...@@ -126,7 +126,7 @@ describe Milestone, models: true do ...@@ -126,7 +126,7 @@ describe Milestone, models: true do
end end
end end
describe :can_be_closed? do describe '#can_be_closed?' do
before do before do
milestone = create :milestone milestone = create :milestone
create :closed_issue, milestone: milestone create :closed_issue, milestone: milestone
......
...@@ -18,11 +18,11 @@ describe Namespace, models: true do ...@@ -18,11 +18,11 @@ describe Namespace, models: true do
it { is_expected.to respond_to(:to_param) } it { is_expected.to respond_to(:to_param) }
end end
describe :to_param do describe '#to_param' do
it { expect(namespace.to_param).to eq(namespace.path) } it { expect(namespace.to_param).to eq(namespace.path) }
end end
describe :human_name do describe '#human_name' do
it { expect(namespace.human_name).to eq(namespace.owner_name) } it { expect(namespace.human_name).to eq(namespace.owner_name) }
end end
...@@ -54,7 +54,7 @@ describe Namespace, models: true do ...@@ -54,7 +54,7 @@ describe Namespace, models: true do
end end
end end
describe :move_dir do describe '#move_dir' do
before do before do
@namespace = create :namespace @namespace = create :namespace
@project = create :project, namespace: @namespace @project = create :project, namespace: @namespace
...@@ -98,7 +98,7 @@ describe Namespace, models: true do ...@@ -98,7 +98,7 @@ describe Namespace, models: true do
end end
end end
describe :find_by_path_or_name do describe '.find_by_path_or_name' do
before do before do
@namespace = create(:namespace, name: 'WoW', path: 'woW') @namespace = create(:namespace, name: 'WoW', path: 'woW')
end end
......
require 'spec_helper' require 'spec_helper'
describe Project, models: true do describe Project, models: true do
describe :authorization do describe 'authorization' do
before do before do
@p1 = create(:project) @p1 = create(:project)
......
...@@ -57,7 +57,7 @@ describe BuildkiteService, models: true do ...@@ -57,7 +57,7 @@ describe BuildkiteService, models: true do
) )
end end
describe :webhook_url do describe '#webhook_url' do
it 'returns the webhook url' do it 'returns the webhook url' do
expect(@service.webhook_url).to eq( expect(@service.webhook_url).to eq(
'https://webhook.buildkite.com/deliver/secret-sauce-webhook-token' 'https://webhook.buildkite.com/deliver/secret-sauce-webhook-token'
...@@ -65,7 +65,7 @@ describe BuildkiteService, models: true do ...@@ -65,7 +65,7 @@ describe BuildkiteService, models: true do
end end
end end
describe :commit_status_path do describe '#commit_status_path' do
it 'returns the correct status page' do it 'returns the correct status page' do
expect(@service.commit_status_path('2ab7834c')).to eq( expect(@service.commit_status_path('2ab7834c')).to eq(
'https://gitlab.buildkite.com/status/secret-sauce-status-token.json?commit=2ab7834c' 'https://gitlab.buildkite.com/status/secret-sauce-status-token.json?commit=2ab7834c'
...@@ -73,7 +73,7 @@ describe BuildkiteService, models: true do ...@@ -73,7 +73,7 @@ describe BuildkiteService, models: true do
end end
end end
describe :build_page do describe '#build_page' do
it 'returns the correct build page' do it 'returns the correct build page' do
expect(@service.build_page('2ab7834c', nil)).to eq( expect(@service.build_page('2ab7834c', nil)).to eq(
'https://buildkite.com/account-name/example-project/builds?commit=2ab7834c' 'https://buildkite.com/account-name/example-project/builds?commit=2ab7834c'
......
...@@ -296,7 +296,7 @@ describe Project, models: true do ...@@ -296,7 +296,7 @@ describe Project, models: true do
end end
end end
describe :update_merge_requests do describe '#update_merge_requests' do
let(:project) { create(:project) } let(:project) { create(:project) }
let(:merge_request) { create(:merge_request, source_project: project, target_project: project) } let(:merge_request) { create(:merge_request, source_project: project, target_project: project) }
let(:key) { create(:key, user_id: project.owner.id) } let(:key) { create(:key, user_id: project.owner.id) }
...@@ -345,7 +345,7 @@ describe Project, models: true do ...@@ -345,7 +345,7 @@ describe Project, models: true do
end end
end end
describe :to_param do describe '#to_param' do
context 'with namespace' do context 'with namespace' do
before do before do
@group = create :group, name: 'gitlab' @group = create :group, name: 'gitlab'
...@@ -356,7 +356,7 @@ describe Project, models: true do ...@@ -356,7 +356,7 @@ describe Project, models: true do
end end
end end
describe :repository do describe '#repository' do
let(:project) { create(:project) } let(:project) { create(:project) }
it 'should return valid repo' do it 'should return valid repo' do
...@@ -364,7 +364,7 @@ describe Project, models: true do ...@@ -364,7 +364,7 @@ describe Project, models: true do
end end
end end
describe :default_issues_tracker? do describe '#default_issues_tracker?' do
let(:project) { create(:project) } let(:project) { create(:project) }
let(:ext_project) { create(:redmine_project) } let(:ext_project) { create(:redmine_project) }
...@@ -377,7 +377,7 @@ describe Project, models: true do ...@@ -377,7 +377,7 @@ describe Project, models: true do
end end
end end
describe :external_issue_tracker do describe '#external_issue_tracker' do
let(:project) { create(:project) } let(:project) { create(:project) }
let(:ext_project) { create(:redmine_project) } let(:ext_project) { create(:redmine_project) }
...@@ -418,7 +418,7 @@ describe Project, models: true do ...@@ -418,7 +418,7 @@ describe Project, models: true do
end end
end end
describe :cache_has_external_issue_tracker do describe '#cache_has_external_issue_tracker' do
let(:project) { create(:project) } let(:project) { create(:project) }
it 'stores true if there is any external_issue_tracker' do it 'stores true if there is any external_issue_tracker' do
...@@ -440,7 +440,7 @@ describe Project, models: true do ...@@ -440,7 +440,7 @@ describe Project, models: true do
end end
end end
describe :open_branches do describe '#open_branches' do
let(:project) { create(:project) } let(:project) { create(:project) }
before do before do
...@@ -517,7 +517,7 @@ describe Project, models: true do ...@@ -517,7 +517,7 @@ describe Project, models: true do
end end
end end
describe :avatar_type do describe '#avatar_type' do
let(:project) { create(:project) } let(:project) { create(:project) }
it 'should be true if avatar is image' do it 'should be true if avatar is image' do
...@@ -531,7 +531,7 @@ describe Project, models: true do ...@@ -531,7 +531,7 @@ describe Project, models: true do
end end
end end
describe :avatar_url do describe '#avatar_url' do
subject { project.avatar_url } subject { project.avatar_url }
let(:project) { create(:project) } let(:project) { create(:project) }
...@@ -568,7 +568,7 @@ describe Project, models: true do ...@@ -568,7 +568,7 @@ describe Project, models: true do
end end
end end
describe :pipeline do describe '#pipeline' do
let(:project) { create :project } let(:project) { create :project }
let(:pipeline) { create :ci_pipeline, project: project, ref: 'master' } let(:pipeline) { create :ci_pipeline, project: project, ref: 'master' }
...@@ -588,7 +588,7 @@ describe Project, models: true do ...@@ -588,7 +588,7 @@ describe Project, models: true do
end end
end end
describe :builds_enabled do describe '#builds_enabled' do
let(:project) { create :project } let(:project) { create :project }
before { project.builds_enabled = true } before { project.builds_enabled = true }
...@@ -690,7 +690,7 @@ describe Project, models: true do ...@@ -690,7 +690,7 @@ describe Project, models: true do
end end
end end
describe :any_runners do describe '#any_runners' do
let(:project) { create(:empty_project, shared_runners_enabled: shared_runners_enabled) } let(:project) { create(:empty_project, shared_runners_enabled: shared_runners_enabled) }
let(:specific_runner) { create(:ci_runner) } let(:specific_runner) { create(:ci_runner) }
let(:shared_runner) { create(:ci_runner, :shared) } let(:shared_runner) { create(:ci_runner, :shared) }
......
...@@ -16,7 +16,7 @@ describe Repository, models: true do ...@@ -16,7 +16,7 @@ describe Repository, models: true do
repository.commit(merge_commit_sha) repository.commit(merge_commit_sha)
end end
describe :branch_names_contains do describe '#branch_names_contains' do
subject { repository.branch_names_contains(sample_commit.id) } subject { repository.branch_names_contains(sample_commit.id) }
it { is_expected.to include('master') } it { is_expected.to include('master') }
...@@ -24,7 +24,7 @@ describe Repository, models: true do ...@@ -24,7 +24,7 @@ describe Repository, models: true do
it { is_expected.not_to include('fix') } it { is_expected.not_to include('fix') }
end end
describe :tag_names_contains do describe '#tag_names_contains' do
subject { repository.tag_names_contains(sample_commit.id) } subject { repository.tag_names_contains(sample_commit.id) }
it { is_expected.to include('v1.1.0') } it { is_expected.to include('v1.1.0') }
...@@ -72,13 +72,13 @@ describe Repository, models: true do ...@@ -72,13 +72,13 @@ describe Repository, models: true do
end end
end end
describe :last_commit_for_path do describe '#last_commit_for_path' do
subject { repository.last_commit_for_path(sample_commit.id, '.gitignore').id } subject { repository.last_commit_for_path(sample_commit.id, '.gitignore').id }
it { is_expected.to eq('c1acaa58bbcbc3eafe538cb8274ba387047b69f8') } it { is_expected.to eq('c1acaa58bbcbc3eafe538cb8274ba387047b69f8') }
end end
describe :find_commits_by_message do describe '#find_commits_by_message' do
subject { repository.find_commits_by_message('submodule').map{ |k| k.id } } subject { repository.find_commits_by_message('submodule').map{ |k| k.id } }
it { is_expected.to include('5937ac0a7beb003549fc5fd26fc247adbce4a52e') } it { is_expected.to include('5937ac0a7beb003549fc5fd26fc247adbce4a52e') }
...@@ -87,7 +87,7 @@ describe Repository, models: true do ...@@ -87,7 +87,7 @@ describe Repository, models: true do
it { is_expected.not_to include('913c66a37b4a45b9769037c55c2d238bd0942d2e') } it { is_expected.not_to include('913c66a37b4a45b9769037c55c2d238bd0942d2e') }
end end
describe :blob_at do describe '#blob_at' do
context 'blank sha' do context 'blank sha' do
subject { repository.blob_at(Gitlab::Git::BLANK_SHA, '.gitignore') } subject { repository.blob_at(Gitlab::Git::BLANK_SHA, '.gitignore') }
...@@ -95,7 +95,7 @@ describe Repository, models: true do ...@@ -95,7 +95,7 @@ describe Repository, models: true do
end end
end end
describe :merged_to_root_ref? do describe '#merged_to_root_ref?' do
context 'merged branch' do context 'merged branch' do
subject { repository.merged_to_root_ref?('improve/awesome') } subject { repository.merged_to_root_ref?('improve/awesome') }
...@@ -103,7 +103,7 @@ describe Repository, models: true do ...@@ -103,7 +103,7 @@ describe Repository, models: true do
end end
end end
describe :can_be_merged? do describe '#can_be_merged?' do
context 'mergeable branches' do context 'mergeable branches' do
subject { repository.can_be_merged?('0b4bc9a49b562e85de7cc9e834518ea6828729b9', 'master') } subject { repository.can_be_merged?('0b4bc9a49b562e85de7cc9e834518ea6828729b9', 'master') }
...@@ -305,7 +305,7 @@ describe Repository, models: true do ...@@ -305,7 +305,7 @@ describe Repository, models: true do
end end
end end
describe :add_branch do describe '#add_branch' do
context 'when pre hooks were successful' do context 'when pre hooks were successful' do
it 'should run without errors' do it 'should run without errors' do
hook = double(trigger: [true, nil]) hook = double(trigger: [true, nil])
...@@ -349,7 +349,7 @@ describe Repository, models: true do ...@@ -349,7 +349,7 @@ describe Repository, models: true do
end end
end end
describe :rm_branch do describe '#rm_branch' do
context 'when pre hooks were successful' do context 'when pre hooks were successful' do
it 'should run without errors' do it 'should run without errors' do
allow_any_instance_of(Gitlab::Git::Hook).to receive(:trigger).and_return([true, nil]) allow_any_instance_of(Gitlab::Git::Hook).to receive(:trigger).and_return([true, nil])
...@@ -386,7 +386,7 @@ describe Repository, models: true do ...@@ -386,7 +386,7 @@ describe Repository, models: true do
end end
end end
describe :commit_with_hooks do describe '#commit_with_hooks' do
context 'when pre hooks were successful' do context 'when pre hooks were successful' do
before do before do
expect_any_instance_of(GitHooksService).to receive(:execute). expect_any_instance_of(GitHooksService).to receive(:execute).
......
...@@ -22,11 +22,11 @@ describe Service, models: true do ...@@ -22,11 +22,11 @@ describe Service, models: true do
@testable = @service.can_test? @testable = @service.can_test?
end end
describe :can_test do describe '#can_test?' do
it { expect(@testable).to eq(true) } it { expect(@testable).to eq(true) }
end end
describe :test do describe '#test' do
let(:data) { 'test' } let(:data) { 'test' }
it 'test runs execute' do it 'test runs execute' do
...@@ -45,7 +45,7 @@ describe Service, models: true do ...@@ -45,7 +45,7 @@ describe Service, models: true do
@testable = @service.can_test? @testable = @service.can_test?
end end
describe :can_test do describe '#can_test?' do
it { expect(@testable).to eq(true) } it { expect(@testable).to eq(true) }
end end
end end
......
...@@ -427,7 +427,7 @@ describe User, models: true do ...@@ -427,7 +427,7 @@ describe User, models: true do
end end
end end
describe :not_in_project do describe '.not_in_project' do
before do before do
User.delete_all User.delete_all
@user = create :user @user = create :user
...@@ -598,7 +598,7 @@ describe User, models: true do ...@@ -598,7 +598,7 @@ describe User, models: true do
end end
end end
describe :avatar_type do describe '#avatar_type' do
let(:user) { create(:user) } let(:user) { create(:user) }
it "should be true if avatar is image" do it "should be true if avatar is image" do
...@@ -612,7 +612,7 @@ describe User, models: true do ...@@ -612,7 +612,7 @@ describe User, models: true do
end end
end end
describe :requires_ldap_check? do describe '#requires_ldap_check?' do
let(:user) { User.new } let(:user) { User.new }
it 'is false when LDAP is disabled' do it 'is false when LDAP is disabled' do
...@@ -651,7 +651,7 @@ describe User, models: true do ...@@ -651,7 +651,7 @@ describe User, models: true do
end end
context 'ldap synchronized user' do context 'ldap synchronized user' do
describe :ldap_user? do describe '#ldap_user?' do
it 'is true if provider name starts with ldap' do it 'is true if provider name starts with ldap' do
user = create(:omniauth_user, provider: 'ldapmain') user = create(:omniauth_user, provider: 'ldapmain')
expect(user.ldap_user?).to be_truthy expect(user.ldap_user?).to be_truthy
...@@ -668,7 +668,7 @@ describe User, models: true do ...@@ -668,7 +668,7 @@ describe User, models: true do
end end
end end
describe :ldap_identity do describe '#ldap_identity' do
it 'returns ldap identity' do it 'returns ldap identity' do
user = create :omniauth_user user = create :omniauth_user
expect(user.ldap_identity.provider).not_to be_empty expect(user.ldap_identity.provider).not_to be_empty
...@@ -825,7 +825,7 @@ describe User, models: true do ...@@ -825,7 +825,7 @@ describe User, models: true do
end end
end end
describe :can_be_removed? do describe '#can_be_removed?' do
subject { create(:user) } subject { create(:user) }
context 'no owned groups' do context 'no owned groups' do
......
...@@ -9,7 +9,7 @@ describe Ci::CreateTriggerRequestService, services: true do ...@@ -9,7 +9,7 @@ describe Ci::CreateTriggerRequestService, services: true do
stub_ci_pipeline_to_return_yaml_file stub_ci_pipeline_to_return_yaml_file
end end
describe :execute do describe '#execute' do
context 'valid params' do context 'valid params' do
subject { service.execute(project, trigger, 'master') } subject { service.execute(project, trigger, 'master') }
......
...@@ -8,7 +8,7 @@ module Ci ...@@ -8,7 +8,7 @@ module Ci
let(:commit) { project.ensure_pipeline(commit_sha, 'master') } let(:commit) { project.ensure_pipeline(commit_sha, 'master') }
let(:build) { FactoryGirl.create(:ci_build, pipeline: commit) } let(:build) { FactoryGirl.create(:ci_build, pipeline: commit) }
describe :execute do describe '#execute' do
before { build } before { build }
context 'branch name' do context 'branch name' do
......
...@@ -13,7 +13,7 @@ module Ci ...@@ -13,7 +13,7 @@ module Ci
specific_runner.assign_to(project) specific_runner.assign_to(project)
end end
describe :execute do describe '#execute' do
context 'runner follow tag list' do context 'runner follow tag list' do
it "picks build with the same tag" do it "picks build with the same tag" do
pending_build.tag_list = ["linux"] pending_build.tag_list = ["linux"]
......
...@@ -9,7 +9,7 @@ describe CreateCommitBuildsService, services: true do ...@@ -9,7 +9,7 @@ describe CreateCommitBuildsService, services: true do
stub_ci_pipeline_to_return_yaml_file stub_ci_pipeline_to_return_yaml_file
end end
describe :execute do describe '#execute' do
context 'valid params' do context 'valid params' do
let(:pipeline) do let(:pipeline) do
service.execute(project, user, service.execute(project, user,
......
...@@ -4,7 +4,7 @@ describe EventCreateService, services: true do ...@@ -4,7 +4,7 @@ describe EventCreateService, services: true do
let(:service) { EventCreateService.new } let(:service) { EventCreateService.new }
describe 'Issues' do describe 'Issues' do
describe :open_issue do describe '#open_issue' do
let(:issue) { create(:issue) } let(:issue) { create(:issue) }
it { expect(service.open_issue(issue, issue.author)).to be_truthy } it { expect(service.open_issue(issue, issue.author)).to be_truthy }
...@@ -14,7 +14,7 @@ describe EventCreateService, services: true do ...@@ -14,7 +14,7 @@ describe EventCreateService, services: true do
end end
end end
describe :close_issue do describe '#close_issue' do
let(:issue) { create(:issue) } let(:issue) { create(:issue) }
it { expect(service.close_issue(issue, issue.author)).to be_truthy } it { expect(service.close_issue(issue, issue.author)).to be_truthy }
...@@ -24,7 +24,7 @@ describe EventCreateService, services: true do ...@@ -24,7 +24,7 @@ describe EventCreateService, services: true do
end end
end end
describe :reopen_issue do describe '#reopen_issue' do
let(:issue) { create(:issue) } let(:issue) { create(:issue) }
it { expect(service.reopen_issue(issue, issue.author)).to be_truthy } it { expect(service.reopen_issue(issue, issue.author)).to be_truthy }
...@@ -36,7 +36,7 @@ describe EventCreateService, services: true do ...@@ -36,7 +36,7 @@ describe EventCreateService, services: true do
end end
describe 'Merge Requests' do describe 'Merge Requests' do
describe :open_mr do describe '#open_mr' do
let(:merge_request) { create(:merge_request) } let(:merge_request) { create(:merge_request) }
it { expect(service.open_mr(merge_request, merge_request.author)).to be_truthy } it { expect(service.open_mr(merge_request, merge_request.author)).to be_truthy }
...@@ -46,7 +46,7 @@ describe EventCreateService, services: true do ...@@ -46,7 +46,7 @@ describe EventCreateService, services: true do
end end
end end
describe :close_mr do describe '#close_mr' do
let(:merge_request) { create(:merge_request) } let(:merge_request) { create(:merge_request) }
it { expect(service.close_mr(merge_request, merge_request.author)).to be_truthy } it { expect(service.close_mr(merge_request, merge_request.author)).to be_truthy }
...@@ -56,7 +56,7 @@ describe EventCreateService, services: true do ...@@ -56,7 +56,7 @@ describe EventCreateService, services: true do
end end
end end
describe :merge_mr do describe '#merge_mr' do
let(:merge_request) { create(:merge_request) } let(:merge_request) { create(:merge_request) }
it { expect(service.merge_mr(merge_request, merge_request.author)).to be_truthy } it { expect(service.merge_mr(merge_request, merge_request.author)).to be_truthy }
...@@ -66,7 +66,7 @@ describe EventCreateService, services: true do ...@@ -66,7 +66,7 @@ describe EventCreateService, services: true do
end end
end end
describe :reopen_mr do describe '#reopen_mr' do
let(:merge_request) { create(:merge_request) } let(:merge_request) { create(:merge_request) }
it { expect(service.reopen_mr(merge_request, merge_request.author)).to be_truthy } it { expect(service.reopen_mr(merge_request, merge_request.author)).to be_truthy }
...@@ -80,7 +80,7 @@ describe EventCreateService, services: true do ...@@ -80,7 +80,7 @@ describe EventCreateService, services: true do
describe 'Milestone' do describe 'Milestone' do
let(:user) { create :user } let(:user) { create :user }
describe :open_milestone do describe '#open_milestone' do
let(:milestone) { create(:milestone) } let(:milestone) { create(:milestone) }
it { expect(service.open_milestone(milestone, user)).to be_truthy } it { expect(service.open_milestone(milestone, user)).to be_truthy }
...@@ -90,7 +90,7 @@ describe EventCreateService, services: true do ...@@ -90,7 +90,7 @@ describe EventCreateService, services: true do
end end
end end
describe :close_mr do describe '#close_mr' do
let(:milestone) { create(:milestone) } let(:milestone) { create(:milestone) }
it { expect(service.close_milestone(milestone, user)).to be_truthy } it { expect(service.close_milestone(milestone, user)).to be_truthy }
...@@ -100,7 +100,7 @@ describe EventCreateService, services: true do ...@@ -100,7 +100,7 @@ describe EventCreateService, services: true do
end end
end end
describe :destroy_mr do describe '#destroy_mr' do
let(:milestone) { create(:milestone) } let(:milestone) { create(:milestone) }
it { expect(service.destroy_milestone(milestone, user)).to be_truthy } it { expect(service.destroy_milestone(milestone, user)).to be_truthy }
......
...@@ -12,7 +12,7 @@ describe Issues::CloseService, services: true do ...@@ -12,7 +12,7 @@ describe Issues::CloseService, services: true do
project.team << [user2, :developer] project.team << [user2, :developer]
end end
describe :execute do describe '#execute' do
context "valid params" do context "valid params" do
before do before do
perform_enqueued_jobs do perform_enqueued_jobs do
......
...@@ -12,7 +12,7 @@ describe MergeRequests::CloseService, services: true do ...@@ -12,7 +12,7 @@ describe MergeRequests::CloseService, services: true do
project.team << [user2, :developer] project.team << [user2, :developer]
end end
describe :execute do describe '#execute' do
context 'valid params' do context 'valid params' do
let(:service) { MergeRequests::CloseService.new(project, user, {}) } let(:service) { MergeRequests::CloseService.new(project, user, {}) }
......
...@@ -5,7 +5,7 @@ describe MergeRequests::CreateService, services: true do ...@@ -5,7 +5,7 @@ describe MergeRequests::CreateService, services: true do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:assignee) { create(:user) } let(:assignee) { create(:user) }
describe :execute do describe '#execute' do
context 'valid params' do context 'valid params' do
let(:opts) do let(:opts) do
{ {
......
...@@ -11,7 +11,7 @@ describe MergeRequests::MergeService, services: true do ...@@ -11,7 +11,7 @@ describe MergeRequests::MergeService, services: true do
project.team << [user2, :developer] project.team << [user2, :developer]
end end
describe :execute do describe '#execute' do
context 'valid params' do context 'valid params' do
let(:service) { MergeRequests::MergeService.new(project, user, commit_message: 'Awesome message') } let(:service) { MergeRequests::MergeService.new(project, user, commit_message: 'Awesome message') }
......
...@@ -5,7 +5,7 @@ describe MergeRequests::RefreshService, services: true do ...@@ -5,7 +5,7 @@ describe MergeRequests::RefreshService, services: true do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:service) { MergeRequests::RefreshService } let(:service) { MergeRequests::RefreshService }
describe :execute do describe '#execute' do
before do before do
@user = create(:user) @user = create(:user)
group = create(:group) group = create(:group)
......
...@@ -11,7 +11,7 @@ describe MergeRequests::ReopenService, services: true do ...@@ -11,7 +11,7 @@ describe MergeRequests::ReopenService, services: true do
project.team << [user2, :developer] project.team << [user2, :developer]
end end
describe :execute do describe '#execute' do
context 'valid params' do context 'valid params' do
let(:service) { MergeRequests::ReopenService.new(project, user, {}) } let(:service) { MergeRequests::ReopenService.new(project, user, {}) }
......
...@@ -9,7 +9,7 @@ describe Milestones::CloseService, services: true do ...@@ -9,7 +9,7 @@ describe Milestones::CloseService, services: true do
project.team << [user, :master] project.team << [user, :master]
end end
describe :execute do describe '#execute' do
before do before do
Milestones::CloseService.new(project, user, {}).execute(milestone) Milestones::CloseService.new(project, user, {}).execute(milestone)
end end
......
...@@ -4,7 +4,7 @@ describe Milestones::CreateService, services: true do ...@@ -4,7 +4,7 @@ describe Milestones::CreateService, services: true do
let(:project) { create(:empty_project) } let(:project) { create(:empty_project) }
let(:user) { create(:user) } let(:user) { create(:user) }
describe :execute do describe '#execute' do
context "valid params" do context "valid params" do
before do before do
project.team << [user, :master] project.team << [user, :master]
......
...@@ -5,7 +5,7 @@ describe Notes::CreateService, services: true do ...@@ -5,7 +5,7 @@ describe Notes::CreateService, services: true do
let(:issue) { create(:issue, project: project) } let(:issue) { create(:issue, project: project) }
let(:user) { create(:user) } let(:user) { create(:user) }
describe :execute do describe '#execute' do
context "valid params" do context "valid params" do
before do before do
project.team << [user, :master] project.team << [user, :master]
......
...@@ -5,7 +5,7 @@ describe Notes::PostProcessService, services: true do ...@@ -5,7 +5,7 @@ describe Notes::PostProcessService, services: true do
let(:issue) { create(:issue, project: project) } let(:issue) { create(:issue, project: project) }
let(:user) { create(:user) } let(:user) { create(:user) }
describe :execute do describe '#execute' do
before do before do
project.team << [user, :master] project.team << [user, :master]
note_opts = { note_opts = {
......
...@@ -50,7 +50,7 @@ describe NotificationService, services: true do ...@@ -50,7 +50,7 @@ describe NotificationService, services: true do
update_custom_notification(:new_note, @u_custom_global) update_custom_notification(:new_note, @u_custom_global)
end end
describe :new_note do describe '#new_note' do
it do it do
add_users_with_subscription(note.project, issue) add_users_with_subscription(note.project, issue)
...@@ -306,7 +306,7 @@ describe NotificationService, services: true do ...@@ -306,7 +306,7 @@ describe NotificationService, services: true do
project.team << [merge_request.assignee, :master] project.team << [merge_request.assignee, :master]
end end
describe :new_note do describe '#new_note' do
it "records sent notifications" do it "records sent notifications" do
# Ensure create SentNotification by noteable = merge_request 6 times, not noteable = note # Ensure create SentNotification by noteable = merge_request 6 times, not noteable = note
expect(SentNotification).to receive(:record_note).with(note, any_args).exactly(4).times.and_call_original expect(SentNotification).to receive(:record_note).with(note, any_args).exactly(4).times.and_call_original
......
...@@ -5,7 +5,7 @@ describe TestHookService, services: true do ...@@ -5,7 +5,7 @@ describe TestHookService, services: true do
let(:project) { create :project } let(:project) { create :project }
let(:hook) { create :project_hook, project: project } let(:hook) { create :project_hook, project: project }
describe :execute do describe '#execute' do
it "should execute successfully" do it "should execute successfully" do
stub_request(:post, hook.url).to_return(status: 200) stub_request(:post, hook.url).to_return(status: 200)
expect(TestHookService.new.execute(hook, user)).to be_truthy expect(TestHookService.new.execute(hook, user)).to be_truthy
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment