Skip to content
Snippets Groups Projects
Commit adc6ec4a authored by Robert Speicher's avatar Robert Speicher
Browse files

Avoid `describe`-ing symbols in specs

parent 158786ca
No related branches found
No related tags found
No related merge requests found
Showing
with 52 additions and 52 deletions
Loading
Loading
@@ -11,7 +11,7 @@ describe NotesFinder do
project.team << [user, :master]
end
 
describe :execute do
describe '#execute' do
let(:params) { { target_id: commit.id, target_type: 'commit', last_fetched_at: 1.hour.ago.to_i } }
 
before do
Loading
Loading
Loading
Loading
@@ -31,7 +31,7 @@ module Ci
})
end
 
describe :only do
describe 'only' do
it "does not return builds if only has another branch" do
config = YAML.dump({
before_script: ["pwd"],
Loading
Loading
@@ -187,7 +187,7 @@ module Ci
end
end
 
describe :except do
describe 'except' do
it "returns builds if except has another branch" do
config = YAML.dump({
before_script: ["pwd"],
Loading
Loading
Loading
Loading
@@ -3,7 +3,7 @@ require 'spec_helper'
describe 'Gitlab::BuildDataBuilder' do
let(:build) { create(:ci_build) }
 
describe :build do
describe '.build' do
let(:data) do
Gitlab::BuildDataBuilder.build(build)
end
Loading
Loading
Loading
Loading
@@ -8,14 +8,14 @@ describe Gitlab::Diff::File, lib: true do
let(:diff) { commit.diffs.first }
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 }
 
it { expect(diff_lines.size).to eq(30) }
it { expect(diff_lines.first).to be_kind_of(Gitlab::Diff::Line) }
end
 
describe :mode_changed? do
describe '#mode_changed?' do
it { expect(diff_file.mode_changed?).to be_falsey }
end
 
Loading
Loading
Loading
Loading
@@ -8,7 +8,7 @@ describe Gitlab::Diff::Parser, lib: true do
let(:diff) { commit.diffs.first }
let(:parser) { Gitlab::Diff::Parser.new }
 
describe :parse do
describe '#parse' do
let(:diff) do
<<eos
--- a/files/ruby/popen.rb
Loading
Loading
Loading
Loading
@@ -4,7 +4,7 @@ describe Gitlab::LDAP::Access, lib: true do
let(:access) { Gitlab::LDAP::Access.new user }
let(:user) { create(:omniauth_user) }
 
describe :allowed? do
describe '#allowed?' do
subject { access.allowed? }
 
context 'when the user cannot be found' do
Loading
Loading
Loading
Loading
@@ -25,7 +25,7 @@ describe Gitlab::LDAP::User, lib: true do
OmniAuth::AuthHash.new(uid: 'my-uid', provider: 'ldapmain', info: info_upper_case)
end
 
describe :changed? do
describe '#changed?' do
it "marks existing ldap user as changed" do
create(:omniauth_user, extern_uid: 'my-uid', provider: 'ldapmain')
expect(ldap_user.changed?).to be_truthy
Loading
Loading
Loading
Loading
@@ -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 :short_sha }
 
describe :valid_commit_sha do
describe '#valid_commit_sha' do
context 'commit.sha can not start with 00000000' do
before do
pipeline.sha = '0' * 40
Loading
Loading
@@ -26,7 +26,7 @@ describe Ci::Pipeline, models: true do
end
end
 
describe :short_sha do
describe '#short_sha' do
subject { pipeline.short_sha }
 
it 'has 8 items' do
Loading
Loading
@@ -35,10 +35,10 @@ describe Ci::Pipeline, models: true do
it { expect(pipeline.sha).to start_with(subject) }
end
 
describe :create_next_builds do
describe '#create_next_builds' do
end
 
describe :retried do
describe '#retried' do
subject { pipeline.retried }
 
before do
Loading
Loading
@@ -51,7 +51,7 @@ describe Ci::Pipeline, models: true do
end
end
 
describe :create_builds do
describe '#create_builds' do
let!(:pipeline) { FactoryGirl.create :ci_pipeline, project: project, ref: 'master', tag: false }
 
def create_builds(trigger_request = nil)
Loading
Loading
Loading
Loading
@@ -9,7 +9,7 @@ describe Ci::Variable, models: true do
subject.value = secret_value
end
 
describe :value do
describe '#value' do
it 'stores the encrypted value' do
expect(subject.encrypted_value).not_to be_nil
end
Loading
Loading
Loading
Loading
@@ -24,14 +24,14 @@ describe CommitStatus, models: true do
it { is_expected.to respond_to :running? }
it { is_expected.to respond_to :pending? }
 
describe :author do
describe '#author' do
subject { commit_status.author }
before { commit_status.author = User.new }
 
it { is_expected.to eq(commit_status.user) }
end
 
describe :started? do
describe '#started?' do
subject { commit_status.started? }
 
context 'without started_at' do
Loading
Loading
@@ -57,7 +57,7 @@ describe CommitStatus, models: true do
end
end
 
describe :active? do
describe '#active?' do
subject { commit_status.active? }
 
%w(pending running).each do |state|
Loading
Loading
@@ -77,7 +77,7 @@ describe CommitStatus, models: true do
end
end
 
describe :complete? do
describe '#complete?' do
subject { commit_status.complete? }
 
%w(success failed canceled).each do |state|
Loading
Loading
@@ -97,7 +97,7 @@ describe CommitStatus, models: true do
end
end
 
describe :duration do
describe '#duration' do
subject { commit_status.duration }
 
it { is_expected.to eq(120.0) }
Loading
Loading
@@ -122,7 +122,7 @@ describe CommitStatus, models: true do
end
end
 
describe :latest do
describe '.latest' do
subject { CommitStatus.latest.order(:id) }
 
before do
Loading
Loading
@@ -138,7 +138,7 @@ describe CommitStatus, models: true do
end
end
 
describe :running_or_pending do
describe '.running_or_pending' do
subject { CommitStatus.running_or_pending.order(:id) }
 
before do
Loading
Loading
Loading
Loading
@@ -7,7 +7,7 @@ describe Mentionable do
nil
end
 
describe :references do
describe 'references' do
let(:project) { create(:project) }
 
it 'excludes JIRA references' do
Loading
Loading
Loading
Loading
@@ -18,7 +18,7 @@ describe ForkedProjectLink, "add link on fork" do
end
end
 
describe :forked_from_project do
describe '#forked?' do
let(:forked_project_link) { build(:forked_project_link) }
let(:project_from) { create(:project) }
let(:project_to) { create(:project, forked_project_link: forked_project_link) }
Loading
Loading
Loading
Loading
@@ -4,33 +4,33 @@ describe GenericCommitStatus, models: true do
let(:pipeline) { FactoryGirl.create :ci_pipeline }
let(:generic_commit_status) { FactoryGirl.create :generic_commit_status, pipeline: pipeline }
 
describe :context do
describe '#context' do
subject { generic_commit_status.context }
before { generic_commit_status.context = 'my_context' }
 
it { is_expected.to eq(generic_commit_status.name) }
end
 
describe :tags do
describe '#tags' do
subject { generic_commit_status.tags }
 
it { is_expected.to eq([:external]) }
end
 
describe :set_default_values do
describe 'set_default_values' do
before do
generic_commit_status.context = nil
generic_commit_status.stage = nil
generic_commit_status.save
end
 
describe :context do
describe '#context' do
subject { generic_commit_status.context }
 
it { is_expected.not_to be_nil }
end
 
describe :stage do
describe '#stage' do
subject { generic_commit_status.stage }
 
it { is_expected.not_to be_nil }
Loading
Loading
Loading
Loading
@@ -14,7 +14,7 @@ describe GlobalMilestone, models: true do
let(:milestone2_project2) { create(:milestone, title: "VD-123", project: project2) }
let(:milestone2_project3) { create(:milestone, title: "VD-123", project: project3) }
 
describe :build_collection do
describe '.build_collection' do
before do
milestones =
[
Loading
Loading
@@ -42,7 +42,7 @@ describe GlobalMilestone, models: true do
end
end
 
describe :initialize do
describe '#initialize' do
before do
milestones =
[
Loading
Loading
@@ -63,7 +63,7 @@ describe GlobalMilestone, models: true do
end
end
 
describe :safe_title do
describe '#safe_title' do
let(:milestone) { create(:milestone, title: "git / test", project: project1) }
 
it 'should strip out slashes and spaces' do
Loading
Loading
Loading
Loading
@@ -97,22 +97,22 @@ describe Group, models: true do
end
end
 
describe :users do
describe '#users' do
it { expect(group.users).to eq(group.owners) }
end
 
describe :human_name do
describe '#human_name' do
it { expect(group.human_name).to eq(group.name) }
end
 
describe :add_users do
describe '#add_user' do
let(:user) { create(:user) }
before { group.add_user(user, GroupMember::MASTER) }
 
it { expect(group.group_members.masters.map(&:user)).to include(user) }
end
 
describe :add_users do
describe '#add_users' do
let(:user) { create(:user) }
before { group.add_users([user.id], GroupMember::GUEST) }
 
Loading
Loading
@@ -124,7 +124,7 @@ describe Group, models: true do
end
end
 
describe :avatar_type do
describe '#avatar_type' do
let(:user) { create(:user) }
before { group.add_user(user, GroupMember::MASTER) }
 
Loading
Loading
Loading
Loading
@@ -101,7 +101,7 @@ describe ProjectMember, models: true do
end
end
 
describe :add_users_into_projects do
describe '.add_users_into_projects' do
before do
@project_1 = create :project
@project_2 = create :project
Loading
Loading
@@ -123,7 +123,7 @@ describe ProjectMember, models: true do
it { expect(@project_2.users).to include(@user_2) }
end
 
describe :truncate_teams do
describe '.truncate_teams' do
before do
@project_1 = create :project
@project_2 = create :project
Loading
Loading
Loading
Loading
@@ -70,7 +70,7 @@ describe Milestone, models: true do
end
end
 
describe :expired? do
describe '#expired?' do
context "expired" do
before do
allow(milestone).to receive(:due_date).and_return(Date.today.prev_year)
Loading
Loading
@@ -88,7 +88,7 @@ describe Milestone, models: true do
end
end
 
describe :percent_complete do
describe '#percent_complete' do
before do
allow(milestone).to receive_messages(
closed_items_count: 3,
Loading
Loading
@@ -111,11 +111,11 @@ describe Milestone, models: true do
it { expect(milestone.is_empty?(user)).to be_falsey }
end
 
describe :can_be_closed? do
describe '#can_be_closed?' do
it { expect(milestone.can_be_closed?).to be_truthy }
end
 
describe :total_items_count do
describe '#total_items_count' do
before do
create :closed_issue, milestone: milestone
create :merge_request, milestone: milestone
Loading
Loading
@@ -126,7 +126,7 @@ describe Milestone, models: true do
end
end
 
describe :can_be_closed? do
describe '#can_be_closed?' do
before do
milestone = create :milestone
create :closed_issue, milestone: milestone
Loading
Loading
Loading
Loading
@@ -18,11 +18,11 @@ describe Namespace, models: true do
it { is_expected.to respond_to(:to_param) }
end
 
describe :to_param do
describe '#to_param' do
it { expect(namespace.to_param).to eq(namespace.path) }
end
 
describe :human_name do
describe '#human_name' do
it { expect(namespace.human_name).to eq(namespace.owner_name) }
end
 
Loading
Loading
@@ -54,7 +54,7 @@ describe Namespace, models: true do
end
end
 
describe :move_dir do
describe '#move_dir' do
before do
@namespace = create :namespace
@project = create :project, namespace: @namespace
Loading
Loading
@@ -98,7 +98,7 @@ describe Namespace, models: true do
end
end
 
describe :find_by_path_or_name do
describe '.find_by_path_or_name' do
before do
@namespace = create(:namespace, name: 'WoW', path: 'woW')
end
Loading
Loading
require 'spec_helper'
 
describe Project, models: true do
describe :authorization do
describe 'authorization' do
before do
@p1 = create(:project)
 
Loading
Loading
Loading
Loading
@@ -57,7 +57,7 @@ describe BuildkiteService, models: true do
)
end
 
describe :webhook_url do
describe '#webhook_url' do
it 'returns the webhook url' do
expect(@service.webhook_url).to eq(
'https://webhook.buildkite.com/deliver/secret-sauce-webhook-token'
Loading
Loading
@@ -65,7 +65,7 @@ describe BuildkiteService, models: true do
end
end
 
describe :commit_status_path do
describe '#commit_status_path' do
it 'returns the correct status page' do
expect(@service.commit_status_path('2ab7834c')).to eq(
'https://gitlab.buildkite.com/status/secret-sauce-status-token.json?commit=2ab7834c'
Loading
Loading
@@ -73,7 +73,7 @@ describe BuildkiteService, models: true do
end
end
 
describe :build_page do
describe '#build_page' do
it 'returns the correct build page' do
expect(@service.build_page('2ab7834c', nil)).to eq(
'https://buildkite.com/account-name/example-project/builds?commit=2ab7834c'
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment