summaryrefslogtreecommitdiff
path: root/spec/models/concerns
diff options
context:
space:
mode:
authordineshpanda <dineshpanda92@gmail.com>2019-08-30 02:09:13 +0530
committerdineshpanda <dineshpanda92@gmail.com>2019-08-30 02:09:13 +0530
commitfa6f19d1f83b68f2bb729be889ab7d66adbbedb8 (patch)
treef33896c818180909073c47075798845d6ba335e1 /spec/models/concerns
parent921d4f37230c8d6d5c097929520bed51e3679a0c (diff)
downloadgitlab-ce-fa6f19d1f83b68f2bb729be889ab7d66adbbedb8.tar.gz
Remove dependency on IgnorableColumn concern
Diffstat (limited to 'spec/models/concerns')
-rw-r--r--spec/models/concerns/ignorable_column_spec.rb44
1 files changed, 0 insertions, 44 deletions
diff --git a/spec/models/concerns/ignorable_column_spec.rb b/spec/models/concerns/ignorable_column_spec.rb
deleted file mode 100644
index 6b82825d2cc..00000000000
--- a/spec/models/concerns/ignorable_column_spec.rb
+++ /dev/null
@@ -1,44 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-describe IgnorableColumn do
- let :base_class do
- Class.new do
- def self.columns
- # This method does not have access to "double"
- [
- Struct.new(:name).new('id'),
- Struct.new(:name).new('title'),
- Struct.new(:name).new('date')
- ]
- end
- end
- end
-
- let :model do
- Class.new(base_class) do
- include IgnorableColumn
- end
- end
-
- describe '.columns' do
- it 'returns the columns, excluding the ignored ones' do
- model.ignore_column(:title, :date)
-
- expect(model.columns.map(&:name)).to eq(%w(id))
- end
- end
-
- describe '.ignored_columns' do
- it 'returns a Set' do
- expect(model.ignored_columns).to be_an_instance_of(Set)
- end
-
- it 'returns the names of the ignored columns' do
- model.ignore_column(:title, :date)
-
- expect(model.ignored_columns).to eq(Set.new(%w(title date)))
- end
- end
-end