Skip to content

Commit

Permalink
Check the raw xml on an SRU response
Browse files Browse the repository at this point in the history
  • Loading branch information
fixlr committed Oct 29, 2009
1 parent 2d9de58 commit 338f738
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions spec/wcapi/sru_search_response_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
@response.should be_an_instance_of(WCAPI::SruSearchResponse)
end

it "should assign the raw xml" do
@response.raw.should == @xml
end

it "should assign an array of records" do
@response.records.should be_an_instance_of(Array)
@response.records.each do |record|
Expand All @@ -16,15 +20,17 @@

describe "with an empty query string" do
before(:all) do
@response = WCAPI::SruSearchResponse.new('')
@xml = ''
@response = WCAPI::SruSearchResponse.new(@xml)
end

it_should_behave_like "a WCAPI::SruSearchResponse"
end

describe "with a sample MARCXML response" do
before(:all) do
@response = WCAPI::SruSearchResponse.new(File.read(File.dirname(__FILE__)+'/../xml/sru_search_response.xml'))
@xml = File.read(File.dirname(__FILE__)+'/../xml/sru_search_response.xml')
@response = WCAPI::SruSearchResponse.new(@xml)
@records = @response.records
end

Expand Down

0 comments on commit 338f738

Please sign in to comment.