Sha256: d38c9db610429e04e808f55e3541996bc672cc80027678f2dfa228e7282f8e3b

Contents?: true

Size: 1.27 KB

Versions: 30

Compression:

Stored size: 1.27 KB

Contents

require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper'))


describe RTurk::HITParser do
  
  before(:all) do
    @hit_xml = <<-XML
<HIT>
  <HITId>ZZRZPTY4ERDZWJ868JCZ</HITId>
  <HITTypeId>NYVZTQ1QVKJZXCYZCZVZ</HITTypeId>
  <CreationTime>2009-07-07T00:56:40Z</CreationTime>
  <Title>Location</Title>
  <Description>Select the image that best represents</Description>
  <HITStatus>Assignable</HITStatus>
  <MaxAssignments>1</MaxAssignments>
  <Reward>
    <Amount>5.00</Amount>
    <CurrencyCode>USD</CurrencyCode>
    <FormattedPrice>$5.00</FormattedPrice>
  </Reward>
  <AutoApprovalDelayInSeconds>2592000</AutoApprovalDelayInSeconds>
  <Expiration>2009-07-14T00:56:40Z</Expiration>
  <AssignmentDurationInSeconds>30</AssignmentDurationInSeconds>
  <NumberOfAssignmentsPending>0</NumberOfAssignmentsPending>
  <NumberOfAssignmentsAvailable>1</NumberOfAssignmentsAvailable>
  <NumberOfAssignmentsCompleted>0</NumberOfAssignmentsCompleted>
</HIT>
      XML
    @hit_xml = Nokogiri::XML(@hit_xml)
    @hit = RTurk::HITParser.new(@hit_xml.children)
  end
  
  it "should parse an answer" do
    @hit.id.should eql('ZZRZPTY4ERDZWJ868JCZ')
    @hit.type_id.should eql('NYVZTQ1QVKJZXCYZCZVZ')
    @hit.status.should eql('Assignable')
    @hit.reward_amount.should eql(5.00)
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
rturk-2.12.1 spec/parsers/hit_parser_spec.rb
rturk-2.12.0 spec/parsers/hit_parser_spec.rb
rturk-2.11.3 spec/parsers/hit_parser_spec.rb
rturk-2.11.2 spec/parsers/hit_parser_spec.rb
rturk-2.11.1 spec/parsers/hit_parser_spec.rb
rturk-2.11.0 spec/parsers/hit_parser_spec.rb
rturk-2.10.3 spec/parsers/hit_parser_spec.rb
rturk-2.10.2 spec/parsers/hit_parser_spec.rb
rturk-2.10.1 spec/parsers/hit_parser_spec.rb
rturk-2.10.0 spec/parsers/hit_parser_spec.rb
rturk-2.9.0 spec/parsers/hit_parser_spec.rb
rturk-2.8.0 spec/parsers/hit_parser_spec.rb
rturk-2.7.0 spec/parsers/hit_parser_spec.rb
rturk-2.6.0 spec/parsers/hit_parser_spec.rb
rturk-2.5.2 spec/parsers/hit_parser_spec.rb
rturk-2.5.0 spec/parsers/hit_parser_spec.rb
rturk-2.4.1 spec/parsers/hit_parser_spec.rb
rturk-2.4.0 spec/parsers/hit_parser_spec.rb
rturk-2.3.6 spec/parsers/hit_parser_spec.rb
rturk-2.3.5 spec/parsers/hit_parser_spec.rb