Skip to content

Commit

Permalink
Add spec for ApiError with html body
Browse files Browse the repository at this point in the history
  • Loading branch information
ellnix committed Jan 17, 2024
1 parent 5c40b93 commit bbcfa7f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions spec/meilisearch/utils_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,14 @@
end.to raise_error(MeiliSearch::ApiError, /I came from Meili server/)
end

it 'spawns same error message with html body' do
expect do
described_class.version_error_handler(:my_method) do
raise MeiliSearch::ApiError.new(405, 'I came from Meili server', '<html><h1>405 Error</h1></html>')
end
end.to raise_error(MeiliSearch::ApiError, /I came from Meili server/)
end

it 'spawns same error message with no body' do
expect do
described_class.version_error_handler(:my_method) do
Expand Down

0 comments on commit bbcfa7f

Please sign in to comment.