@@ -24,7 +24,7 @@ class DummyImportingModel
24
24
25
25
module DummyImportingAdapter
26
26
module ImportingMixin
27
- def __find_in_batches ( options = { } , &block )
27
+ def __find_in_batches ( options = { } , &block )
28
28
yield if block_given?
29
29
end
30
30
def __transform
@@ -125,7 +125,7 @@ def importing_mixin
125
125
context 'when the method is called with the force option' do
126
126
before do
127
127
expect ( DummyImportingModel ) . to receive ( :create_index! ) . with ( force : true , index : 'foo' ) . and_return ( true )
128
- expect ( DummyImportingModel ) . to receive ( :__find_in_batches ) . with ( foo : 'bar' ) . and_return ( true )
128
+ expect ( DummyImportingModel ) . to receive ( :__find_in_batches ) . with ( { foo : 'bar' } ) . and_return ( true )
129
129
end
130
130
131
131
it 'deletes and creates the index' do
@@ -136,7 +136,7 @@ def importing_mixin
136
136
context 'when the method is called with the refresh option' do
137
137
before do
138
138
expect ( DummyImportingModel ) . to receive ( :refresh_index! ) . with ( index : 'foo' ) . and_return ( true )
139
- expect ( DummyImportingModel ) . to receive ( :__find_in_batches ) . with ( foo : 'bar' ) . and_return ( true )
139
+ expect ( DummyImportingModel ) . to receive ( :__find_in_batches ) . with ( { foo : 'bar' } ) . and_return ( true )
140
140
end
141
141
142
142
it 'refreshes the index' do
@@ -147,7 +147,7 @@ def importing_mixin
147
147
context 'when a different index name is provided' do
148
148
before do
149
149
expect ( DummyImportingModel ) . to receive ( :client ) . and_return ( client )
150
- expect ( client ) . to receive ( :bulk ) . with ( body : nil , index : 'my-new-index' ) . and_return ( response )
150
+ expect ( client ) . to receive ( :bulk ) . with ( { body : nil , index : 'my-new-index' } ) . and_return ( response )
151
151
end
152
152
153
153
it 'uses the alternate index name' do
@@ -203,7 +203,7 @@ def importing_mixin
203
203
context 'when a pipeline is provided as an options' do
204
204
before do
205
205
expect ( DummyImportingModel ) . to receive ( :client ) . and_return ( client )
206
- expect ( client ) . to receive ( :bulk ) . with ( body : nil , index : 'foo' , pipeline : 'my-pipeline' ) . and_return ( response )
206
+ expect ( client ) . to receive ( :bulk ) . with ( { body : nil , index : 'foo' , pipeline : 'my-pipeline' } ) . and_return ( response )
207
207
end
208
208
209
209
it 'uses the pipeline option' do
0 commit comments