Sha256: b7ac8adc8f4608cc16cf24c19291c136ddbb9f1cce6774a726b9cf8a5505ed2a

Contents?: true

Size: 802 Bytes

Versions: 1

Compression:

Stored size: 802 Bytes

Contents

require File.dirname(__FILE__) + '/spec_helper'


describe RTurk::Answer do
  
  before(:all) do
    @answer =  "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
    <QuestionFormAnswers xmlns=\"http://mechanicalturk.amazonaws.com/AWSMechanicalTurkDataSchemas/2005-10-01/QuestionFormAnswers.xsd\">
    <Answer>\n<QuestionIdentifier>tweet</QuestionIdentifier>\n<FreeText>Spec example</FreeText>\n</Answer>
    <Answer>\n<QuestionIdentifier>Submit</QuestionIdentifier>\n<FreeText>Submit</FreeText>\n</Answer>
    <Answer>\n<QuestionIdentifier>Foo</QuestionIdentifier>\n<RandomSelector>Bar</RandomSelector>\n</Answer>
    </QuestionFormAnswers>\n"
  end
  
  it "should parse an answer" do
    RTurk::Answer.parse(@answer).should == {'Submit' => 'Submit', 'tweet' => 'Spec example', 'Foo' => 'Bar'}
  end
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
markpercival-rturk-1.0.3 spec/answer_spec.rb