Skip to content

Commit bb04fc6

Browse files
committed
Update snapshot specs
1 parent ef5c561 commit bb04fc6

File tree

11 files changed

+55
-11
lines changed

11 files changed

+55
-11
lines changed

elasticsearch-api/spec/elasticsearch/api/actions/snapshot/clone_spec.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@
2424
'_snapshot/foo/bar/_clone/snapshot',
2525
{},
2626
{},
27-
{}
27+
{},
28+
{ defined_params:
29+
{ repository: 'foo', snapshot: 'bar', target_snapshot: 'snapshot' },
30+
endpoint: 'snapshot.clone' }
2831
]
2932
end
3033

elasticsearch-api/spec/elasticsearch/api/actions/snapshot/create_repository_spec.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525
'_snapshot/foo',
2626
{},
2727
{},
28-
{}
28+
{},
29+
{ defined_params: { repository: 'foo' },
30+
endpoint: 'snapshot.create_repository' }
2931
]
3032
end
3133

elasticsearch-api/spec/elasticsearch/api/actions/snapshot/create_spec.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525
'_snapshot/foo/bar',
2626
{},
2727
{},
28-
{}
28+
{},
29+
{ defined_params: { repository: 'foo', snapshot: 'bar' },
30+
endpoint: 'snapshot.create' }
2931
]
3032
end
3133

elasticsearch-api/spec/elasticsearch/api/actions/snapshot/delete_repository_spec.rb

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525
url,
2626
{},
2727
nil,
28-
{}
28+
{},
29+
{ defined_params: { repository: 'foo' },
30+
endpoint: 'snapshot.delete_repository' }
2931
]
3032
end
3133

@@ -43,6 +45,18 @@
4345
'_snapshot/foo,bar'
4446
end
4547

48+
let(:expected_args) do
49+
[
50+
'DELETE',
51+
url,
52+
{},
53+
nil,
54+
{},
55+
{ defined_params: { repository: ['foo','bar'] },
56+
endpoint: 'snapshot.delete_repository' }
57+
]
58+
end
59+
4660
it 'performs the request' do
4761
expect(client_double.snapshot.delete_repository(repository: ['foo','bar'])).to be_a Elasticsearch::API::Response
4862
end

elasticsearch-api/spec/elasticsearch/api/actions/snapshot/delete_spec.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525
'_snapshot/foo/bar',
2626
{},
2727
nil,
28-
{}
28+
{},
29+
{ defined_params: { repository: 'foo', snapshot: 'bar' },
30+
endpoint: 'snapshot.delete' }
2931
]
3032
end
3133

elasticsearch-api/spec/elasticsearch/api/actions/snapshot/get_repository_spec.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
'_snapshot/foo',
2626
{},
2727
nil,
28-
{}
28+
{},
29+
{ defined_params: { repository: 'foo' }, endpoint: 'snapshot.get_repository' }
2930
]
3031
end
3132

elasticsearch-api/spec/elasticsearch/api/actions/snapshot/get_spec.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525
'_snapshot/foo/bar',
2626
{},
2727
nil,
28-
{}
28+
{},
29+
{ defined_params: { repository: 'foo', snapshot: 'bar' },
30+
endpoint: 'snapshot.get' }
2931
]
3032
end
3133

elasticsearch-api/spec/elasticsearch/api/actions/snapshot/repository_analize_spec.rb

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

elasticsearch-api/spec/elasticsearch/api/actions/snapshot/restore_spec.rb

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

elasticsearch-api/spec/elasticsearch/api/actions/snapshot/status_spec.rb

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
url,
2626
{},
2727
nil,
28-
{}
28+
{},
29+
{ endpoint: 'snapshot.status' }
2930
]
3031
end
3132

@@ -42,6 +43,17 @@
4243
'_snapshot/foo/bar/_status'
4344
end
4445

46+
let(:expected_args) do
47+
[
48+
'GET',
49+
url,
50+
{},
51+
nil,
52+
{},
53+
{ defined_params: { repository: 'foo', snapshot: 'bar' }, endpoint: 'snapshot.status' }
54+
]
55+
end
56+
4557
it 'performs the request' do
4658
expect(client_double.snapshot.status(repository: 'foo', snapshot: 'bar')).to be_a Elasticsearch::API::Response
4759
end

elasticsearch-api/spec/elasticsearch/api/actions/snapshot/verify_repository_spec.rb

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

0 commit comments

Comments
 (0)