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.2.1 spec/unit/serialization/date_spec.rb
rest_model-0.2.0 spec/unit/serialization/date_spec.rb
rest_model-0.1.24 spec/unit/serialization/date_spec.rb
rest_model-0.1.23 spec/unit/serialization/date_spec.rb
rest_model-0.1.22 spec/unit/serialization/date_spec.rb
rest_model-0.1.21 spec/unit/serialization/date_spec.rb
rest_model-0.1.20 spec/unit/serialization/date_spec.rb
rest_model-0.1.19 spec/unit/serialization/date_spec.rb
rest_model-0.1.18 spec/unit/serialization/date_spec.rb
rest_model-0.1.17 spec/unit/serialization/date_spec.rb
rest_model-0.1.16 spec/unit/serialization/date_spec.rb
rest_model-0.1.15 spec/unit/serialization/date_spec.rb
rest_model-0.1.14 spec/unit/serialization/date_spec.rb
rest_model-0.1.13 spec/unit/serialization/date_spec.rb
rest_model-0.1.12 spec/unit/serialization/date_spec.rb
rest_model-0.1.11 spec/unit/serialization/date_spec.rb
rest_model-0.1.10 spec/unit/serialization/date_spec.rb
rest_model-0.1.9 spec/unit/serialization/date_spec.rb
rest_model-0.1.8 spec/unit/serialization/date_spec.rb
rest_model-0.1.7 spec/unit/serialization/date_spec.rb