# -*- encoding: utf-8 -*- require 'spec_helper' describe "oai/list_records.xml.builder" do fixtures :all before(:each) do view.stub(:current_user_role_name).and_return('Guest') assign(:oai, { :errors => [] }) manifestations = [ FactoryGirl.create(:manifestation) ] manifestations.stub(:last_page?){true} manifestations.stub(:total_count){manifestations.size} assign(:manifestations, manifestations) end it "renders the XML template" do render expect(rendered).to match // end it "renders dc:date" do manifestations = [FactoryGirl.create(:manifestation, pub_date: '2015-08-15')] manifestations.stub(:last_page?){true} manifestations.stub(:total_count){manifestations.size} assign(:manifestations, manifestations) render expect(rendered).to match /2015-08-15/ end describe "when metadataPrefix is oai_dc" do before(:each) do assign(:oai, { :errors => [], :metadataPrefix => 'oai_dc' } ) end it "renders the XML template" do render expect(rendered).to match / [], :metadataPrefix => 'junii2' } ) end it "renders the XML template" do render expect(rendered).to match /Journal Article<\/NIItype>/ end end end