Skip to content

Commit 69ee0e1

Browse files
committed
Update searchable_snapshots specs
1 parent b411561 commit 69ee0e1

File tree

4 files changed

+45
-4
lines changed

4 files changed

+45
-4
lines changed

elasticsearch-api/spec/elasticsearch/api/actions/searchable_snapshots/cache_stats_spec.rb

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
url,
2525
{},
2626
nil,
27-
{}
27+
{},
28+
{ endpoint: 'searchable_snapshots.cache_stats' }
2829
]
2930
end
3031

@@ -37,6 +38,17 @@
3738
context 'when using index' do
3839
let(:url){ '_searchable_snapshots/foo/cache/stats' }
3940

41+
let(:expected_args) do
42+
[
43+
'GET',
44+
url,
45+
{},
46+
nil,
47+
{},
48+
{ defined_params: { node_id: 'foo' }, endpoint: 'searchable_snapshots.cache_stats' }
49+
]
50+
end
51+
4052
it 'performs the request' do
4153
expect(client_double.searchable_snapshots.cache_stats(node_id: 'foo')).to be_a Elasticsearch::API::Response
4254
end

elasticsearch-api/spec/elasticsearch/api/actions/searchable_snapshots/clear_cache_spec.rb

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
url,
2525
{},
2626
nil,
27-
{}
27+
{},
28+
{ endpoint: 'searchable_snapshots.clear_cache' }
2829
]
2930
end
3031

@@ -37,6 +38,18 @@
3738
context 'when using index' do
3839
let(:url){ 'foo/_searchable_snapshots/cache/clear' }
3940

41+
let(:expected_args) do
42+
[
43+
'POST',
44+
url,
45+
{},
46+
nil,
47+
{},
48+
{ defined_params: { index: 'foo' },
49+
endpoint: 'searchable_snapshots.clear_cache' }
50+
]
51+
end
52+
4053
it 'performs the request' do
4154
expect(client_double.searchable_snapshots.clear_cache(index: 'foo')).to be_a Elasticsearch::API::Response
4255
end

elasticsearch-api/spec/elasticsearch/api/actions/searchable_snapshots/mount_spec.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@
2424
'_snapshot/foo/bar/_mount',
2525
{},
2626
{},
27-
{}
27+
{},
28+
{ defined_params: { repository: 'foo', snapshot: 'bar' },
29+
endpoint: 'searchable_snapshots.mount' }
2830
]
2931
end
3032

elasticsearch-api/spec/elasticsearch/api/actions/searchable_snapshots/stats_spec.rb

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,12 @@
2424
url,
2525
{},
2626
nil,
27-
{}
27+
{},
28+
{ endpoint: 'searchable_snapshots.stats' }
2829
]
2930
end
31+
32+
3033
let(:url) { '_searchable_snapshots/stats' }
3134

3235
it 'performs the request' do
@@ -36,6 +39,17 @@
3639
context 'using index' do
3740
let(:url) { 'foo/_searchable_snapshots/stats' }
3841

42+
let(:expected_args) do
43+
[
44+
'GET',
45+
url,
46+
{},
47+
nil,
48+
{},
49+
{ defined_params: { index: 'foo' }, endpoint: 'searchable_snapshots.stats' }
50+
]
51+
end
52+
3953
it 'performs the request' do
4054
expect(client_double.searchable_snapshots.stats(index: 'foo')).to be_a Elasticsearch::API::Response
4155
end

0 commit comments

Comments
 (0)