Skip to content

Commit 589fd76

Browse files
Kelly Joseph Pricepicandocodigo
authored andcommitted
Add spec
1 parent 63c24c9 commit 589fd76

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

elasticsearch-model/spec/elasticsearch/model/importing_spec.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,5 +227,17 @@ def importing_mixin
227227
end
228228
end
229229
end
230+
231+
context 'when a pipeline is provided as an options' do
232+
233+
before do
234+
expect(DummyImportingModel).to receive(:client).and_return(client)
235+
expect(client).to receive(:bulk).with(body: nil, index: 'foo', type: 'foo', pipeline: 'my-pipeline').and_return(response)
236+
end
237+
238+
it 'uses the pipeline option' do
239+
expect(DummyImportingModel.import(pipeline: 'my-pipeline')).to eq(0)
240+
end
241+
end
230242
end
231243
end

0 commit comments

Comments
 (0)