require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper')) describe RTurk::QualificationTypeParser do before(:all) do @qualification_type_xml = <<-XML WKAZMYZDCYCZP412TZEZ 2009-05-17T10:05:15Z WebReviews Qualification Master Test This qualification will allow you to earn more on the WebReviews HITs. WebReviews, webreviews, web reviews Active WebReviews Survey After you have filled out this survey you will be assigned one or more qualifications... age What is your age? true Please choose the age group you belong to. radiobutton 0018 -18 5160 51-60 6000 60+ 1200 XML @qualification_type_xml = Nokogiri::XML(@qualification_type_xml) @qualification_type = RTurk::QualificationTypeParser.new(@qualification_type_xml.children) end it "should parse an answer" do @qualification_type.qualification_type_id.should eql('WKAZMYZDCYCZP412TZEZ') @qualification_type.status.should eql('Active') @qualification_type.name.should eql('WebReviews Qualification Master Test') @qualification_type.keywords.should eql('WebReviews, webreviews, web reviews') end end