Skip to content

Commit bc83237

Browse files
committed
add basic test
1 parent a20cc1f commit bc83237

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

lib/mindee/v2/parsing/search.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44
require_relative 'search/search_model'
55
require_relative 'search/search_models'
66
require_relative 'search/search_response'
7+
require_relative 'search/model_webhook'
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# frozen_string_literal: true
2+
3+
require 'mindee'
4+
require 'mindee/v2/parsing/search'
5+
6+
describe Mindee::V2::Parsing::Search::SearchResponse do
7+
it 'initializes' do
8+
json_file_path = File.join(V2_DATA_DIR, 'search', 'models.json')
9+
10+
response = described_class.new(JSON.parse(File.read(json_file_path)))
11+
12+
expect(response).not_to be_nil
13+
expect(response.models.size).to eq(5)
14+
model_0 = response.models[0]
15+
expect(model_0.name).to eq('Extraction With Webhooks')
16+
expect(model_0.webhooks.size).to eq(2)
17+
expect(model_0.webhooks[0].url).to eq('https://failure.mindee.com')
18+
end
19+
end

0 commit comments

Comments
 (0)