Sha256: 5802f7751b73d6a972886e8cad75790f51525ebe909f2a9161023c2753fa13bd

Contents?: true

Size: 781 Bytes

Versions: 1

Compression:

Stored size: 781 Bytes

Contents

# encoding: UTF-8

require 'spec_helper'

describe Esearch::Mixin::Document, '#index' do

  let(:object) { class_under_test.new(connection) }

  let(:class_under_test) do
    Class.new do
      include Concord.new(:connection), Esearch::Mixin::Document
    end
  end

  context 'with one arg' do
    subject { object.index(document) }
    let(:document) { double('Document') }

    let(:expected_arguments) { [document, {}] }

    expect_to_run_command(Esearch::Command::Document::Index)
  end

  context 'with two args' do
    subject { object.index(document, options) }
    let(:document) { double('Document') }
    let(:options)  { double('Options') }

    let(:expected_arguments) { [document, options] }

    expect_to_run_command(Esearch::Command::Document::Index)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
esearch-0.2.2 spec/unit/esearch/mixin/document/index_spec.rb