summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2018-12-15 02:01:24 +0800
committerRémy Coutable <remy@rymai.me>2018-12-19 11:24:55 +0100
commitc3641185f47eb7c775906a31f099460b34053aea (patch)
tree0cdbcb11366c99e4ac564a8b565fe9dd4a8ec064
parent25ef6f51c9899cc26661a2daac7ca0d47b95d443 (diff)
downloadgitlab-ce-c3641185f47eb7c775906a31f099460b34053aea.tar.gz
Fix cacheable_attributes_spec.rb by adding column_names
-rw-r--r--spec/models/concerns/cacheable_attributes_spec.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/spec/models/concerns/cacheable_attributes_spec.rb b/spec/models/concerns/cacheable_attributes_spec.rb
index 827fbc9d7d5..689e7d3058f 100644
--- a/spec/models/concerns/cacheable_attributes_spec.rb
+++ b/spec/models/concerns/cacheable_attributes_spec.rb
@@ -20,6 +20,10 @@ describe CacheableAttributes do
@_last ||= new('foo' => 'a', 'bar' => 'b')
end
+ def self.column_names
+ %w[foo bar baz]
+ end
+
attr_accessor :attributes
def initialize(attrs = {}, *)
@@ -75,13 +79,13 @@ describe CacheableAttributes do
context 'without any attributes given' do
it 'intializes a new object with the defaults' do
- expect(minimal_test_class.build_from_defaults.attributes).to eq(minimal_test_class.defaults)
+ expect(minimal_test_class.build_from_defaults.attributes).to eq(minimal_test_class.defaults.stringify_keys)
end
end
context 'with attributes given' do
it 'intializes a new object with the given attributes merged into the defaults' do
- expect(minimal_test_class.build_from_defaults(foo: 'd').attributes[:foo]).to eq('d')
+ expect(minimal_test_class.build_from_defaults(foo: 'd').attributes['foo']).to eq('d')
end
end