diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2018-12-15 02:01:24 +0800 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2018-12-19 11:24:55 +0100 |
commit | c3641185f47eb7c775906a31f099460b34053aea (patch) | |
tree | 0cdbcb11366c99e4ac564a8b565fe9dd4a8ec064 | |
parent | 25ef6f51c9899cc26661a2daac7ca0d47b95d443 (diff) | |
download | gitlab-ce-c3641185f47eb7c775906a31f099460b34053aea.tar.gz |
Fix cacheable_attributes_spec.rb by adding column_names
-rw-r--r-- | spec/models/concerns/cacheable_attributes_spec.rb | 8 |
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 |