Sha256: faf37412cc8750f90a0dae855b12a7b4befcbe389a48ce25044637101b63f2f3

Contents?: true

Size: 819 Bytes

Versions: 1

Compression:

Stored size: 819 Bytes

Contents

# encoding: UTF-8

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.2 spec/unit/esearch/mixin/document/index_create_spec.rb