spec/unit/encyclopedia_spec.rb in animenewsnetwork-0.0.2 vs spec/unit/encyclopedia_spec.rb in animenewsnetwork-0.0.3
- old
+ new
@@ -15,10 +15,15 @@
reports_xml = File.new(File.expand_path('../../resources/reports_xml_id_155_type_anime', __FILE__))
stub_http_request(:get, "cdn.animenewsnetwork.com/encyclopedia/reports.xml")
.with(query: { id: 155, type: "anime", nlist: "all" })
.to_return(body: reports_xml)
+ reports_xml = File.new(File.expand_path('../../resources/reports_xml_id_155_type_anime', __FILE__))
+ stub_http_request(:get, "cdn.animenewsnetwork.com/encyclopedia/reports.xml")
+ .with(query: { id: 155, name: "foo", search: "bar baz" })
+ .to_return(body: reports_xml)
+
api_xml = File.new(File.expand_path('../../resources/api_xml_anime_4658', __FILE__))
stub_http_request(:get, "cdn.animenewsnetwork.com/encyclopedia/api.xml")
.with(query: { anime: 4658 })
.to_return(body: api_xml)
end
@@ -33,9 +38,13 @@
subject { ann.get_reports(id: 155, type: 'anime', nskip: 10, nlist: 10) }
it { should be_a Nokogiri::XML::Document }
end
describe "GET reports nlist all" do
subject { ann.get_reports(id: 155, type: 'anime', nlist: 'all') }
+ it { should be_a Nokogiri::XML::Document }
+ end
+ describe "GET reports name & search" do
+ subject { ann.get_reports(id: 155, name: "foo", search: "bar baz") }
it { should be_a Nokogiri::XML::Document }
end
describe "GET details" do
subject { ann.get_details(id: 4658, type: 'anime') }