Sha256: 68a2078849a0b3633143c0a6b2612eb01366e859ca2a91c32b23aa366ceea781

Contents?: true

Size: 618 Bytes

Versions: 3

Compression:

Stored size: 618 Bytes

Contents

# frozen_string_literal: true
# rubocop:todo all

require 'lite_spec_helper'

describe 'Atlas connectivity' do
  let(:uri) { ENV['ATLAS_URI'] }
  let(:client) { Mongo::Client.new(uri) }

  before do
    if uri.nil?
      skip "ATLAS_URI not set in environment"
    end
  end

  describe 'connection to Atlas' do
    it 'runs ismaster successfully' do
      result = client.database.command(:ismaster => 1)
      expect(result.documents.first['ismaster']).to be true
    end

    it 'runs findOne successfully' do
      result = client.use(:test)['test'].find.to_a
      expect(result).to be_a(Array)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
mongo-2.19.2 spec/atlas/atlas_connectivity_spec.rb
mongo-2.19.1 spec/atlas/atlas_connectivity_spec.rb
mongo-2.19.0 spec/atlas/atlas_connectivity_spec.rb