Sha256: 5a5d1f50a2fd1db22a61da9b02e8d658e787fa8ef6afb09af3056f82e927f36b

Contents?: true

Size: 340 Bytes

Versions: 27

Compression:

Stored size: 340 Bytes

Contents

require 'spec_helper'

describe RestModel::Serialization::Date do
  it "converts to date" do
    subject.class.serialize('2011-07-01').should == Date.new(2011, 07, 01)
  end

  context "when an invalid value is serialized" do
    it "raises an error" do
      expect {subject.class.serialize("not a date")}.to raise_error
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
rest_model-0.1.6 spec/unit/serialization/date_spec.rb
rest_model-0.1.5 spec/unit/serialization/date_spec.rb
rest_model-0.1.4 spec/unit/serialization/date_spec.rb
rest_model-0.1.3 spec/unit/serialization/date_spec.rb
rest_model-0.1.2 spec/unit/serialization/date_spec.rb
rest_model-0.1.1 spec/unit/serialization/date_spec.rb
rest_model-0.1.0 spec/unit/serialization/date_spec.rb