Sha256: c7eb6c46e34d662b63c99738b56836b96d092086bff64b2333c9ca8c74503e45

Contents?: true

Size: 793 Bytes

Versions: 1

Compression:

Stored size: 793 Bytes

Contents

require 'spec_helper'

describe Esearch::Mixin::Document, '#index_update' 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_update(document) }
    let(:document) { mock('Document') }

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

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

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

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

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
esearch-0.2.0 spec/unit/esearch/mixin/document/index_update_spec.rb