ruby on rails - How to test serialize column? -
i have in model this:
class mymodel < activerecord::base serialize :my_column, array end
how test it?
today i'm testing this:
it "column serialize array" subject.my_column.is_a?(array).must_equal true end
i'm using gem "minitest-rails-shoulda"
is there way test this?
tanks
you can shoulda-matchers.
class mymodeltest < activesupport::testcase should serialize(:my_column) end
check out code comments, should pretty straightforward.
if on rails 5, watch out there an issue.
Comments
Post a Comment