Sha256: b319a1abb07418183f6c90b186790b60afa07fbb56bb5f7ce97fe3d7c315a6f9

Contents?: true

Size: 794 Bytes

Versions: 3

Compression:

Stored size: 794 Bytes

Contents

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


describe RTurk::Answers do
  
  before(:all) do
    @answer =  <<-XML
&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;QuestionFormAnswers xmlns="http://mechanicalturk.amazonaws.com/AWSMechanicalTurkDataSchemas/2005-10-01/QuestionFormAnswers.xsd"&gt;
&lt;Answer&gt;
&lt;QuestionIdentifier&gt;tweet&lt;/QuestionIdentifier&gt;
&lt;FreeText&gt;This is my tweet!&lt;/FreeText&gt;
&lt;/Answer&gt;
&lt;Answer&gt;
&lt;QuestionIdentifier&gt;Submit&lt;/QuestionIdentifier&gt;
&lt;FreeText&gt;Submit&lt;/FreeText&gt;
&lt;/Answer&gt;
&lt;/QuestionFormAnswers&gt;
XML
  end
  
  it "should parse a answer" do
    RTurk::Answers.new(@answer).to_hash.should == {"Submit"=>"Submit", "tweet"=>"This is my tweet!"}
  end

  
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rturk-2.0.2 spec/adapters/answers_spec.rb
rturk-2.0.1 spec/adapters/answers_spec.rb
rturk-2.0.0 spec/adapters/answers_spec.rb