# frozen_string_literal: true
# This file is part of Alexandria.
#
# See the file README.md for authorship and licensing information.
require "spec_helper"
RSpec.describe Alexandria::BookProviders::ThaliaProvider do
let(:normal_people_main) do
+<<~HTML
Artikel von 0571334652 ansehen | Thalia
HTML
end
let(:normal_people_details) do
+<<~HTML
Normal People von Sally Rooney - Taschenbuch - 978-0-571-33465-0 | Thalia
Einband | Taschenbuch |
Erscheinungsdatum | 02.05.2019 |
ISBN | 978-0-571-33465-0 |
HTML
end
it "works when searching by ISBN" do
stub_request(:get,
"https://www.thalia.de/shop/bde_bu_hg_startseite/suche/?sq=0571334652")
.to_return(status: 200, body: normal_people_main, headers: {})
stub_request(:get, "https://www.thalia.de/shop/home/artikeldetails/ID134292338.html")
.to_return(status: 200, body: normal_people_details, headers: {})
assert_correct_search_result(described_class, "9780571334650")
end
end