diff --git a/lib/oai/provider/response/list_identifiers.rb b/lib/oai/provider/response/list_identifiers.rb index a58419d..4703ffb 100755 --- a/lib/oai/provider/response/list_identifiers.rb +++ b/lib/oai/provider/response/list_identifiers.rb @@ -1,7 +1,8 @@ module OAI::Provider::Response class ListIdentifiers < RecordResponse - + required_parameters :metadata_prefix + def to_xml result = provider.model.find(:all, options) diff --git a/test/activerecord_provider/tc_ar_provider.rb b/test/activerecord_provider/tc_ar_provider.rb index 30e1973..24fe109 100755 --- a/test/activerecord_provider/tc_ar_provider.rb +++ b/test/activerecord_provider/tc_ar_provider.rb @@ -53,8 +53,10 @@ def test_get_record_alternate_identifier_column end def test_list_identifiers - assert_nothing_raised { REXML::Document.new(@provider.list_identifiers) } - doc = REXML::Document.new(@provider.list_identifiers) + assert_nothing_raised do + REXML::Document.new(@provider.list_identifiers(:metadata_prefix => 'oai_dc')) + end + doc = REXML::Document.new(@provider.list_identifiers(:metadata_prefix => 'oai_dc')) assert_equal 100, doc.elements['OAI-PMH/ListIdentifiers'].to_a.size end @@ -163,7 +165,7 @@ def test_handles_empty_collections test_metadata_formats # ListIdentifiers and ListRecords should return "noRecordsMatch" error code assert_raises(OAI::NoMatchException) do - REXML::Document.new(@provider.list_identifiers) + REXML::Document.new(@provider.list_identifiers(:metadata_prefix => 'oai_dc')) end assert_raises(OAI::NoMatchException) do REXML::Document.new(@provider.list_records(:metadata_prefix => 'oai_dc')) diff --git a/test/provider/tc_provider.rb b/test/provider/tc_provider.rb index 2e3d100..cf571c4 100644 --- a/test/provider/tc_provider.rb +++ b/test/provider/tc_provider.rb @@ -15,7 +15,8 @@ def test_additional_description end def test_list_identifiers_for_correct_xml - doc = REXML::Document.new(@mapped_provider.list_identifiers) + doc = REXML::Document.new( + @mapped_provider.list_identifiers(:metadata_prefix => 'oai_dc')) assert_not_nil doc.elements['OAI-PMH/request'] assert_not_nil doc.elements['OAI-PMH/request/@verb'] assert_not_nil doc.elements['OAI-PMH/ListIdentifiers']