Closed einzige closed 6 years ago
It may also require you to add conditional spec / code depending on a currently running rails/AR version, eg: if ActiveRecord.version < 4 then add serialization, run this spec.
Doubt that it would require version checks. Serialized columns should work irrespective of whichever version we're on right? Let me know your thoughts. Thanks.
@ritikesh yep, sounds right.
Let's check if it is really saved in specs
@einzige when I ran specs, it ran with 0 failures. How about you?
@ritikesh 0 failures, but we need to make sure a serialized column gets saved. For instance:
it 'updates serialized column' do
expect do
fake.config = {one: :two}
fake.sneaky_save!
end.to change { fake.reload.config }.from(nil).to(one: :two)
end
@ritikesh
Going forward, let's have our updates separated in commits.
For a spec, you'll need to update
spec/spe_helper.rb
where you'll find a test class called "Fake", just add a new column to it and serialize the way you did in your app.It may also require you to add conditional spec / code depending on a currently running rails/AR version, eg:
if ActiveRecord.version < 4 then add serialization, run this spec