Sha256: 6e4bd351d24e84547ce6309dc36a005f40aae745a45517e1e9a1bfd5e44545f4
Contents?: true
Size: 731 Bytes
Versions: 3
Compression:
Stored size: 731 Bytes
Contents
# require 'test_helper' # require 'mongoid' # require 'mongoid/document' # class MongoidTest < MiniTest::Spec # describe "Mongoid compatibility" do # it "allows #to_json" do # class Profile # include Mongoid::Document # field :name # end # class Dude # include Mongoid::Document # embeds_one :profile, :class_name => "MongoidTest::Profile" # end # module ProfileRepresenter # include Representable::JSON # property :name # end # dude = Dude.new # dude.profile = Profile.new # dude.profile.name = "Kofi" # assert_equal "{\"name\":\"Kofi\"}", dude.profile.extend(ProfileRepresenter).to_json # end # end # end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
representable-3.0.4 | test/mongoid_test.rb |
representable-3.0.3 | test/mongoid_test.rb |
representable-3.0.2 | test/mongoid_test.rb |