Commit c3641185 authored by Lin Jen-Shin's avatar Lin Jen-Shin Committed by Rémy Coutable

Fix cacheable_attributes_spec.rb by adding column_names

parent 25ef6f51
...@@ -20,6 +20,10 @@ describe CacheableAttributes do ...@@ -20,6 +20,10 @@ describe CacheableAttributes do
@_last ||= new('foo' => 'a', 'bar' => 'b') @_last ||= new('foo' => 'a', 'bar' => 'b')
end end
def self.column_names
%w[foo bar baz]
end
attr_accessor :attributes attr_accessor :attributes
def initialize(attrs = {}, *) def initialize(attrs = {}, *)
...@@ -75,13 +79,13 @@ describe CacheableAttributes do ...@@ -75,13 +79,13 @@ describe CacheableAttributes do
context 'without any attributes given' do context 'without any attributes given' do
it 'intializes a new object with the defaults' 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
end end
context 'with attributes given' do context 'with attributes given' do
it 'intializes a new object with the given attributes merged into the defaults' 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
end end
......
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