Sha256: 6d3f3cf5ce5913aeac7245497b4db321b29ca70b758bbf3df974b36c54dbdd7a

Contents?: true

Size: 821 Bytes

Versions: 2

Compression:

Stored size: 821 Bytes

Contents

# (c) 2017 Ribose Inc.
#

require_relative "shared_examples"

RSpec.describe "Attr Masker gem", :suppress_progressbar do
  context "when used with Mongoid" do
    before do
      if ENV["WITHOUT_MONGOID"]
        expect(defined?(::Mongoid)).to be(nil)
        skip "Mongoid specs disabled with WITHOUT_MONGOID shell variable"
      end
    end

    after do
      # Remove the example-specific model from Mongoid.models
      ::Mongoid.models.delete(user_class_definition)
    end

    let(:user_class_definition) do
      Class.new do
        include Mongoid::Document
        include Mongoid::Timestamps

        store_in collection: "users"

        field :first_name
        field :last_name
        field :email
        field :avatar
      end
    end

    include_examples "Attr Masker gem feature specs"
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
attr_masker-0.2.1 spec/features/mongoid_spec.rb
attr_masker-0.2.0 spec/features/mongoid_spec.rb