Sha256: 4ec272d303876d478f56a8adcc8ed76c53ae65e9963357f0c917c77d1e212e5d

Contents?: true

Size: 540 Bytes

Versions: 27

Compression:

Stored size: 540 Bytes

Contents

# frozen_string_literal: true
# encoding: utf-8

require "spec_helper"

describe BSON::ObjectId do

  describe "#as_json" do

    let(:object_id) do
      described_class.new
    end

    it "returns the $oid plus string" do
      expect(object_id.as_json).to eq("$oid" => object_id.to_s)
    end
  end
end

describe BSON::Document do

  describe "#symbolize_keys" do

    let(:doc) do
      described_class.new("foo" => "bar")
    end

    it "returns key as symbol" do
      expect(doc.symbolize_keys.keys).to eq [:foo]
    end
  end
end

Version data entries

27 entries across 27 versions & 2 rubygems

Version Path
mongoid-7.3.5 spec/mongoid/extensions_spec.rb
mongoid-7.3.4 spec/mongoid/extensions_spec.rb
mongoid-7.1.11 spec/mongoid/extensions_spec.rb
mongoid-7.2.6 spec/mongoid/extensions_spec.rb
mongoid-7.3.3 spec/mongoid/extensions_spec.rb
mongoid-7.3.2 spec/mongoid/extensions_spec.rb
mongoid-7.2.5 spec/mongoid/extensions_spec.rb
mongoid-7.1.10 spec/mongoid/extensions_spec.rb
mongoid-7.1.9 spec/mongoid/extensions_spec.rb
mongoid-7.2.4 spec/mongoid/extensions_spec.rb
mongoid-7.3.1 spec/mongoid/extensions_spec.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/mongoid-7.1.7/spec/mongoid/extensions_spec.rb
mongoid-7.3.0 spec/mongoid/extensions_spec.rb
mongoid-7.2.3 spec/mongoid/extensions_spec.rb
mongoid-7.1.8 spec/mongoid/extensions_spec.rb
mongoid-7.2.2 spec/mongoid/extensions_spec.rb
mongoid-7.2.1 spec/mongoid/extensions_spec.rb
mongoid-7.1.7 spec/mongoid/extensions_spec.rb
mongoid-7.2.0 spec/mongoid/extensions_spec.rb
mongoid-7.1.6 spec/mongoid/extensions_spec.rb