Sha256: bc6d6dcd56d0ebee9fc2068c33485f4a7cf57b4a720f5f5304550a337f9cce6b

Contents?: true

Size: 1.21 KB

Versions: 14

Compression:

Stored size: 1.21 KB

Contents

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

describe RTurk::AssignQualification do
  before(:all) do
    aws = YAML.load(File.open(File.join(SPEC_ROOT, 'mturk.yml')))
    RTurk.setup(aws['AWSAccessKeyId'], aws['AWSAccessKey'], :sandbox => true)
    faker('assign_qualification', :operation => 'AssignQualification')
  end

  it "should ensure required params" do
    lambda{RTurk::AssignQualification()}.should raise_error RTurk::MissingParameters
  end

  it "should successfully request the operation" do
    RTurk::Requester.should_receive(:request).once.with(
      hash_including('Operation' => 'AssignQualification', 'IntegerValue' => 80))
    RTurk::AssignQualification(:qualification_type_id => "123456789",
                               :worker_id => "ABCDEF1234",
                               :integer_value => 80) rescue RTurk::InvalidRequest
  end

  it "should parse and return the result" do
    RTurk::AssignQualification(:qualification_type_id => "123456789",
                               :worker_id => "ABCDEF1234",
                               :integer_value => 80).elements.should eql(
      {"AssignQualificationResult"=>{"Request"=>{"IsValid"=>"True"}}}
    )
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
rturk-2.12.1 spec/operations/assign_qualification_spec.rb
rturk-2.12.0 spec/operations/assign_qualification_spec.rb
rturk-2.11.3 spec/operations/assign_qualification_spec.rb
rturk-2.11.2 spec/operations/assign_qualification_spec.rb
rturk-2.11.1 spec/operations/assign_qualification_spec.rb
rturk-2.11.0 spec/operations/assign_qualification_spec.rb
rturk-2.10.3 spec/operations/assign_qualification_spec.rb
rturk-2.10.2 spec/operations/assign_qualification_spec.rb
rturk-2.10.1 spec/operations/assign_qualification_spec.rb
rturk-2.10.0 spec/operations/assign_qualification_spec.rb
rturk-2.9.0 spec/operations/assign_qualification_spec.rb
rturk-2.8.0 spec/operations/assign_qualification_spec.rb
rturk-2.7.0 spec/operations/assign_qualification_spec.rb
rturk-2.6.0 spec/operations/assign_qualification_spec.rb