Sha256: dae0a14d0aaaf960f28e851edeebcf2c5cafc90f90918e1f726ca7fa10cd9385

Contents?: true

Size: 727 Bytes

Versions: 2

Compression:

Stored size: 727 Bytes

Contents

describe(OmniAuth::Identity::Models::DataMapper, :db => true) do
  class DataMapperTestIdentity
    include DataMapper::Resource
    include OmniAuth::Identity::Models::DataMapper

    property :id,              Serial
    auth_key :ham_sandwich
  end


  before :all do
    DataMapper.finalize
    @resource = DataMapperTestIdentity.new
  end

  describe 'model', type: :model do
    subject { DataMapperTestIdentity }

    it 'should delegate locate to the all query method' do
      allow(subject).to receive(:all).with('ham_sandwich' => 'open faced', 'category' => 'sandwiches').and_return(['wakka'])
      expect(subject.locate('ham_sandwich' => 'open faced', 'category' => 'sandwiches')).to eq('wakka')
    end
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
omniauth-identity-2.0.0 spec/omniauth/identity/models/data_mapper_spec.rb
omniauth-identity2-2.0 spec/omniauth/identity/models/data_mapper_spec.rb