Sha256: 73a470d5e498108c0bc45253c3d9660f13edda0fed31f66ccb97e6d1d782cd7d

Contents?: true

Size: 568 Bytes

Versions: 3

Compression:

Stored size: 568 Bytes

Contents

require "spec_helper"

describe Mongoid::JSON do

  describe ".include_root_in_json" do

    let(:person) do
      Person.new
    end

    context "when config set to true" do

      before do
        Mongoid.include_root_in_json = true
      end

      it "returns true" do
        person.include_root_in_json.should be_true
      end
    end

    context "when config set to false" do

      before do
        Mongoid.include_root_in_json = false
      end

      it "returns false" do
        person.include_root_in_json.should be_false
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
mongoid-3.1.7 spec/mongoid/json_spec.rb
mongoid-3.1.6 spec/mongoid/json_spec.rb
mongoid-3.1.5 spec/mongoid/json_spec.rb