Sha256: 75e902123e732158be627a9fb18130f18ccf535a19454fe71776b1607f5beb0c

Contents?: true

Size: 800 Bytes

Versions: 1

Compression:

Stored size: 800 Bytes

Contents

require 'spec_helper'

describe Esearch::Mixin::Document, '#index_create' 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_create(document) }
    let(:document) { double('Document') }

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

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

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

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

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
esearch-0.2.1 spec/unit/esearch/mixin/document/index_create_spec.rb