Sha256: c53293685129a0ff0e5e37da3701ec3355abf348cfabc2d5541a80279de2202c

Contents?: true

Size: 798 Bytes

Versions: 3

Compression:

Stored size: 798 Bytes

Contents

# frozen_string_literal: true

require 'sequel'
# Connect to an in-memory sqlite3 database.
DB = Sequel.sqlite
DB.create_table :sequel_test_identities do
  primary_key :id
  String :ham_sandwich, null: false
  String :password_digest, null: false
end

class SequelTestIdentity < Sequel::Model
  include OmniAuth::Identity::Models::Sequel
  auth_key :ham_sandwich
end

RSpec.describe(OmniAuth::Identity::Models::Sequel, db: true) do
  it 'delegates locate to the where query method' do
    allow(SequelTestIdentity).to receive(:where).with('ham_sandwich' => 'open faced',
                                                      'category' => 'sandwiches').and_return(['wakka'])
    expect(SequelTestIdentity.locate('ham_sandwich' => 'open faced', 'category' => 'sandwiches')).to eq('wakka')
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
omniauth-identity-3.0.6 spec/omniauth/identity/models/sequel_spec.rb
omniauth-identity-3.0.5 spec/omniauth/identity/models/sequel_spec.rb
omniauth-identity-3.0.4 spec/omniauth/identity/models/sequel_spec.rb