Skip to content

Commit 609bbd2

Browse files
Update the opensearch-rails gem (RM-2427).
- Fix `searching_search_request_spec.rb`: explicitly expect a options hash instead of keyword arguments when stubbing.
1 parent 4174f66 commit 609bbd2

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

opensearch-model/spec/opensearch/model/searching_search_request_spec.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def self.document_type; 'bar'; end
4444
context 'when the search definition is a simple query' do
4545

4646
before do
47-
expect(client).to receive(:search).with(index: 'foo', q: 'foo').and_return({})
47+
expect(client).to receive(:search).with({ index: 'foo', q: 'foo' }).and_return({})
4848
end
4949

5050
let(:search) do
@@ -59,7 +59,7 @@ def self.document_type; 'bar'; end
5959
context 'when the search definition is a hash' do
6060

6161
before do
62-
expect(client).to receive(:search).with(index: 'foo', body: { foo: 'bar' }).and_return({})
62+
expect(client).to receive(:search).with({ index: 'foo', body: { foo: 'bar' } }).and_return({})
6363
end
6464

6565
let(:search) do
@@ -74,7 +74,7 @@ def self.document_type; 'bar'; end
7474
context 'when the search definition is a json string' do
7575

7676
before do
77-
expect(client).to receive(:search).with(index: 'foo', body: '{"foo":"bar"}').and_return({})
77+
expect(client).to receive(:search).with({ index: 'foo', body: '{"foo":"bar"}' }).and_return({})
7878
end
7979

8080
let(:search) do
@@ -99,7 +99,7 @@ def to_hash; {foo: 'bar'}; end
9999
end
100100

101101
before do
102-
expect(client).to receive(:search).with(index: 'foo', body: {foo: 'bar'}).and_return({})
102+
expect(client).to receive(:search).with({ index: 'foo', body: { foo: 'bar' } }).and_return({})
103103
end
104104

105105
let(:search) do
@@ -114,7 +114,7 @@ def to_hash; {foo: 'bar'}; end
114114
context 'when extra options are specified' do
115115

116116
before do
117-
expect(client).to receive(:search).with(index: 'foo', q: 'foo', size: 15).and_return({})
117+
expect(client).to receive(:search).with({ index: 'foo', q: 'foo', size: 15 }).and_return({})
118118
end
119119

120120
let(:search) do

0 commit comments

Comments
 (0)