Sha256: debb02ff5f8e1b24d8302aaf26dc52fc3f527d0f716c6d99533c03b568474036

Contents?: true

Size: 535 Bytes

Versions: 6

Compression:

Stored size: 535 Bytes

Contents

require 'spec_helper'

describe(OmniAuth::Identity::Models::ActiveRecord, :db => true) do
  class TestIdentity < OmniAuth::Identity::Models::ActiveRecord
    auth_key :ham_sandwich
  end

  it 'should locate using the auth key using a where query' do
    TestIdentity.should_receive(:where).with('ham_sandwich' => 'open faced').and_return(['wakka'])
    TestIdentity.locate('open faced').should == 'wakka'
  end
  
  it 'should not use STI rules for its table name' do
    TestIdentity.table_name.should == 'test_identities'
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
omniauth-identity-1.1.0 spec/omniauth/identity/models/active_record_spec.rb
omniauth-identity-1.0.0 spec/omniauth/identity/models/active_record_spec.rb
omniauth-identity-1.0.0.rc2 spec/omniauth/identity/models/active_record_spec.rb
omniauth-identity-1.0.0.rc1 spec/omniauth/identity/models/active_record_spec.rb
omniauth-identity-1.0.0.beta1 spec/omniauth/identity/models/active_record_spec.rb
omniauth-identity-1.0.0.pr2 spec/omniauth/identity/models/active_record_spec.rb