Sha256: 110d1b60e897b00c0283e281565c974807cc718717233a8118c58a727b6d03af

Contents?: true

Size: 717 Bytes

Versions: 31

Compression:

Stored size: 717 Bytes

Contents

require 'spec_helper'

require_relative '../../../lib/locomotive/steam/adapters/mongodb.rb'

describe Locomotive::Steam::MongoDBAdapter do

  let(:adapter) { described_class.new(nil) }

  describe '#key' do

    subject { adapter.key(:title, :in) }

    it { is_expected.to eq :title.in }

  end

  describe '#make_id' do

    let(:id) { '56fd9f48a2f42217744a85d7' }

    subject { adapter.make_id(id) }

    it { is_expected.to eq(BSON::ObjectId.from_string('56fd9f48a2f42217744a85d7')) }

    context 'passing a BSON::ObjectId' do

      let(:id) { BSON::ObjectId.from_string('56fd9f48a2f42217744a85d7') }

      it { is_expected.to eq(BSON::ObjectId.from_string('56fd9f48a2f42217744a85d7')) }

    end

  end

end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
locomotivecms_steam-1.8.0.alpha2 spec/unit/adapters/mongodb_adapter_spec.rb
locomotivecms_steam-1.8.0.alpha1 spec/unit/adapters/mongodb_adapter_spec.rb
locomotivecms_steam-1.7.1 spec/unit/adapters/mongodb_adapter_spec.rb
locomotivecms_steam-1.7.0 spec/unit/adapters/mongodb_adapter_spec.rb
locomotivecms_steam-1.6.1 spec/unit/adapters/mongodb_adapter_spec.rb
locomotivecms_steam-1.6.0 spec/unit/adapters/mongodb_adapter_spec.rb
locomotivecms_steam-1.6.0.rc1 spec/unit/adapters/mongodb_adapter_spec.rb
locomotivecms_steam-1.6.0.beta1 spec/unit/adapters/mongodb_adapter_spec.rb
locomotivecms_steam-1.5.3 spec/unit/adapters/mongodb_adapter_spec.rb
locomotivecms_steam-1.5.2 spec/unit/adapters/mongodb_adapter_spec.rb
locomotivecms_steam-1.5.1 spec/unit/adapters/mongodb_adapter_spec.rb
locomotivecms_steam-1.5.0 spec/unit/adapters/mongodb_adapter_spec.rb
locomotivecms_steam-1.5.0.rc1 spec/unit/adapters/mongodb_adapter_spec.rb
locomotivecms_steam-1.5.0.rc0 spec/unit/adapters/mongodb_adapter_spec.rb
locomotivecms_steam-1.5.0.beta3 spec/unit/adapters/mongodb_adapter_spec.rb
locomotivecms_steam-1.5.0.beta2 spec/unit/adapters/mongodb_adapter_spec.rb
locomotivecms_steam-1.5.0.beta1 spec/unit/adapters/mongodb_adapter_spec.rb
locomotivecms_steam-1.4.1 spec/unit/adapters/mongodb_adapter_spec.rb
locomotivecms_steam-1.4.0 spec/unit/adapters/mongodb_adapter_spec.rb
locomotivecms_steam-1.4.0.rc2 spec/unit/adapters/mongodb_adapter_spec.rb