Sha256: 3b59b8afd32cc2c4fd46f24385df476821e54db66921ee3ede9c0fce9bf35835

Contents?: true

Size: 679 Bytes

Versions: 1

Compression:

Stored size: 679 Bytes

Contents

require 'spec_helper'

describe(OmniAuth::Identity::Models::Mongoid, :db => true) do
  class MongoidTestIdentity
    include Mongoid::Document
    include OmniAuth::Identity::Models::Mongoid
    auth_key :ham_sandwich
  end

  it 'should delegate locate to the where query method' do
    MongoidTestIdentity.should_receive(:where).with('ham_sandwich' => 'open faced', 'category' => 'sandwiches').and_return(['wakka'])
    MongoidTestIdentity.locate('ham_sandwich' => 'open faced', 'category' => 'sandwiches').should == 'wakka'
  end

  it 'should not use STI rules for its collection name' do
    MongoidTestIdentity.collection.name.should == 'mongoid_test_identities'
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
omniauth-identity-1.1.1 spec/omniauth/identity/models/mongoid_spec.rb