Commit 45a5ed6d authored by Shinya Maeda's avatar Shinya Maeda

fix wording

parent bec4740f
require 'spec_helper' require 'spec_helper'
describe Ci::BuildMetadata do describe Ci::BuildMetadata do
it_behaves_like 'Unique enum values' it_behaves_like 'having unique enum values'
set(:user) { create(:user) } set(:user) { create(:user) }
set(:group) { create(:group, :access_requestable) } set(:group) { create(:group, :access_requestable) }
......
...@@ -3,7 +3,7 @@ require 'spec_helper' ...@@ -3,7 +3,7 @@ require 'spec_helper'
describe Ci::BuildTraceChunk, :clean_gitlab_redis_shared_state do describe Ci::BuildTraceChunk, :clean_gitlab_redis_shared_state do
include ExclusiveLeaseHelpers include ExclusiveLeaseHelpers
it_behaves_like 'Unique enum values' it_behaves_like 'having unique enum values'
set(:build) { create(:ci_build, :running) } set(:build) { create(:ci_build, :running) }
let(:chunk_index) { 0 } let(:chunk_index) { 0 }
......
require 'spec_helper' require 'spec_helper'
describe Ci::JobArtifact do describe Ci::JobArtifact do
it_behaves_like 'Unique enum values' it_behaves_like 'having unique enum values'
let(:artifact) { create(:ci_job_artifact, :archive) } let(:artifact) { create(:ci_job_artifact, :archive) }
......
require 'spec_helper' require 'spec_helper'
describe Ci::Pipeline, :mailer do describe Ci::Pipeline, :mailer do
it_behaves_like 'Unique enum values' it_behaves_like 'having unique enum values'
let(:user) { create(:user) } let(:user) { create(:user) }
set(:project) { create(:project) } set(:project) { create(:project) }
......
require 'spec_helper' require 'spec_helper'
describe Ci::Runner do describe Ci::Runner do
it_behaves_like 'Unique enum values' it_behaves_like 'having unique enum values'
describe 'validation' do describe 'validation' do
it { is_expected.to validate_presence_of(:access_level) } it { is_expected.to validate_presence_of(:access_level) }
......
require 'spec_helper' require 'spec_helper'
describe Ci::Stage, :models do describe Ci::Stage, :models do
it_behaves_like 'Unique enum values' it_behaves_like 'having unique enum values'
let(:stage) { create(:ci_stage_entity) } let(:stage) { create(:ci_stage_entity) }
......
require 'rails_helper' require 'rails_helper'
describe Clusters::Applications::Ingress do describe Clusters::Applications::Ingress do
it_behaves_like 'Unique enum values' it_behaves_like 'having unique enum values'
let(:ingress) { create(:clusters_applications_ingress) } let(:ingress) { create(:clusters_applications_ingress) }
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
require 'spec_helper' require 'spec_helper'
describe Clusters::Cluster do describe Clusters::Cluster do
it_behaves_like 'Unique enum values' it_behaves_like 'having unique enum values'
it { is_expected.to belong_to(:user) } it { is_expected.to belong_to(:user) }
it { is_expected.to have_many(:cluster_projects) } it { is_expected.to have_many(:cluster_projects) }
......
...@@ -4,7 +4,7 @@ describe Clusters::Platforms::Kubernetes, :use_clean_rails_memory_store_caching ...@@ -4,7 +4,7 @@ describe Clusters::Platforms::Kubernetes, :use_clean_rails_memory_store_caching
include KubernetesHelpers include KubernetesHelpers
include ReactiveCachingHelpers include ReactiveCachingHelpers
it_behaves_like 'Unique enum values' it_behaves_like 'having unique enum values'
it { is_expected.to belong_to(:cluster) } it { is_expected.to belong_to(:cluster) }
it { is_expected.to be_kind_of(Gitlab::Kubernetes) } it { is_expected.to be_kind_of(Gitlab::Kubernetes) }
......
require 'spec_helper' require 'spec_helper'
describe CommitStatus do describe CommitStatus do
it_behaves_like 'Unique enum values' it_behaves_like 'having unique enum values'
set(:project) { create(:project, :repository) } set(:project) { create(:project, :repository) }
......
...@@ -16,7 +16,7 @@ describe Deployment do ...@@ -16,7 +16,7 @@ describe Deployment do
it { is_expected.to validate_presence_of(:ref) } it { is_expected.to validate_presence_of(:ref) }
it { is_expected.to validate_presence_of(:sha) } it { is_expected.to validate_presence_of(:sha) }
it_behaves_like 'Unique enum values' it_behaves_like 'having unique enum values'
describe '#scheduled_actions' do describe '#scheduled_actions' do
subject { deployment.scheduled_actions } subject { deployment.scheduled_actions }
......
require 'rails_helper' require 'rails_helper'
RSpec.describe GpgSignature do RSpec.describe GpgSignature do
it_behaves_like 'Unique enum values' it_behaves_like 'having unique enum values'
let(:commit_sha) { '0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33' } let(:commit_sha) { '0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33' }
let!(:project) { create(:project, :repository, path: 'sample-project') } let!(:project) { create(:project, :repository, path: 'sample-project') }
......
require 'spec_helper' require 'spec_helper'
describe InternalId do describe InternalId do
it_behaves_like 'Unique enum values' it_behaves_like 'having unique enum values'
let(:project) { create(:project) } let(:project) { create(:project) }
let(:usage) { :issues } let(:usage) { :issues }
......
require 'rails_helper' require 'rails_helper'
describe List do describe List do
it_behaves_like 'Unique enum values' it_behaves_like 'having unique enum values'
describe 'relationships' do describe 'relationships' do
it { is_expected.to belong_to(:board) } it { is_expected.to belong_to(:board) }
......
require 'rails_helper' require 'rails_helper'
RSpec.describe NotificationSetting do RSpec.describe NotificationSetting do
it_behaves_like 'Unique enum values' it_behaves_like 'having unique enum values'
describe "Associations" do describe "Associations" do
it { is_expected.to belong_to(:user) } it { is_expected.to belong_to(:user) }
......
require 'spec_helper' require 'spec_helper'
describe ProjectAutoDevops do describe ProjectAutoDevops do
it_behaves_like 'Unique enum values' it_behaves_like 'having unique enum values'
set(:project) { build(:project) } set(:project) { build(:project) }
......
...@@ -4,7 +4,7 @@ describe Project do ...@@ -4,7 +4,7 @@ describe Project do
include ProjectForksHelper include ProjectForksHelper
include GitHelpers include GitHelpers
it_behaves_like 'Unique enum values' it_behaves_like 'having unique enum values'
describe 'associations' do describe 'associations' do
it { is_expected.to belong_to(:group) } it { is_expected.to belong_to(:group) }
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
require 'spec_helper' require 'spec_helper'
describe PrometheusMetric do describe PrometheusMetric do
it_behaves_like 'Unique enum values' it_behaves_like 'having unique enum values'
subject { build(:prometheus_metric) } subject { build(:prometheus_metric) }
let(:other_project) { build(:project) } let(:other_project) { build(:project) }
......
require 'spec_helper' require 'spec_helper'
describe PushEventPayload do describe PushEventPayload do
it_behaves_like 'Unique enum values' it_behaves_like 'having unique enum values'
describe 'saving payloads' do describe 'saving payloads' do
it 'does not allow commit messages longer than 70 characters' do it 'does not allow commit messages longer than 70 characters' do
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
require 'rails_helper' require 'rails_helper'
RSpec.describe ResourceLabelEvent, type: :model do RSpec.describe ResourceLabelEvent, type: :model do
it_behaves_like 'Unique enum values' it_behaves_like 'having unique enum values'
subject { build(:resource_label_event, issue: issue) } subject { build(:resource_label_event, issue: issue) }
let(:issue) { create(:issue) } let(:issue) { create(:issue) }
......
require 'rails_helper' require 'rails_helper'
describe UserCallout do describe UserCallout do
it_behaves_like 'Unique enum values' it_behaves_like 'having unique enum values'
let!(:callout) { create(:user_callout) } let!(:callout) { create(:user_callout) }
......
...@@ -4,7 +4,7 @@ describe User do ...@@ -4,7 +4,7 @@ describe User do
include ProjectForksHelper include ProjectForksHelper
include TermsHelper include TermsHelper
it_behaves_like 'Unique enum values' it_behaves_like 'having unique enum values'
describe 'modules' do describe 'modules' do
subject { described_class } subject { described_class }
......
# frozen_string_literal: true # frozen_string_literal: true
shared_examples 'Unique enum values' do shared_examples 'having unique enum values' do
described_class.defined_enums.each do |name, enum| described_class.defined_enums.each do |name, enum|
it "has unique values in #{name.inspect}" do it "has unique values in #{name.inspect}" do
duplicated = enum.group_by(&:last).select { |key, value| value.size > 1 } duplicated = enum.group_by(&:last).select { |key, value| value.size > 1 }
......
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