Skip to content

Commit b9d288f

Browse files
committed
[API] Migrates find_structure test to RSpec
1 parent 104cbfa commit b9d288f

File tree

1 file changed

+14
-19
lines changed

1 file changed

+14
-19
lines changed

elasticsearch-api/spec/platinum/unit/text_structure/find_structure_test.rb renamed to elasticsearch-api/spec/elasticsearch/api/actions/text_structure/find_structure_spec.rb

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,26 +15,21 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18-
require 'test_helper'
18+
require 'spec_helper'
1919

20-
module Elasticsearch
21-
module Test
22-
class XPackTextStructureFindStructureTest < Minitest::Test
23-
context "XPack Text Structure: Find structure" do
24-
subject { FakeClient.new }
25-
26-
should "perform correct request" do
27-
subject.expects(:perform_request).with do |method, url, params, body|
28-
assert_equal('POST', method)
29-
assert_equal('_text_structure/find_structure', url)
30-
assert_equal(params, {})
31-
assert_equal(body, {})
32-
true
33-
end.returns(FakeResponse.new)
20+
describe 'client.text_structure#test_grok_pattern' do
21+
let(:expected_args) do
22+
[
23+
'POST',
24+
'_text_structure/find_structure',
25+
{},
26+
{},
27+
{"Content-Type"=>"application/x-ndjson"},
28+
{ endpoint: 'text_structure.find_structure' }
29+
]
30+
end
3431

35-
subject.text_structure.find_structure(body: {})
36-
end
37-
end
38-
end
32+
it 'performs the request' do
33+
expect(client_double.text_structure.find_structure(body: {})).to be_a Elasticsearch::API::Response
3934
end
4035
end

0 commit comments

Comments
 (0)