spec/acfs/resource/attributes_spec.rb in acfs-1.5.1 vs spec/acfs/resource/attributes_spec.rb in acfs-1.6.0
- old
+ new
@@ -46,14 +46,14 @@
model.attribute :age, :integer, default: 25
model.send :define_method, :name= do |name|
write_attribute :name, "The Great #{name}"
end
end
- let(:args) { [params] }
let(:params) { {name: 'James'} }
+ let(:opts) { {} }
let(:m) { model.new }
- let(:action) { -> { m.write_attributes(*args) } }
+ let(:action) { -> { m.write_attributes(params, **opts) } }
subject { action }
it 'should update attributes' do
should change(m, :attributes)
.from(name: 'The Great John', age: 25)
@@ -77,10 +77,10 @@
.from(name: 'The Great John', age: 25)
.to(name: 'The Great James', age: 25, born_at: 'today')
end
context 'with unknown: :raise option' do
- let(:args) { [params, {unknown: :raise}] }
+ let(:opts) { {unknown: :raise} }
it { should raise_error(ArgumentError, /unknown attribute/i) }
it do
expect do