Sha256: fda5be90c0178e2053fbd197832f38dcc46be7a8a4345e1a12f743fd74e48ad3

Contents?: true

Size: 1.21 KB

Versions: 20

Compression:

Stored size: 1.21 KB

Contents

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

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

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

  it "should successfully request the operation" do
    RTurk::Requester.should_receive(:request).once.with(
    hash_including('Operation' => 'GetQualificationRequests'))
    RTurk::GetQualificationRequests(:qualification_type_id => '789RVWYBAZW00EXAMPLE') rescue RTurk::InvalidRequest
  end

  it "should parse and return the result" do
    response = RTurk::GetQualificationRequests(:qualification_type_id => '789RVWYBAZW00EXAMPLE')
    response.num_results.should == 1
    response.qualification_requests.length.should == 1
    response.qualification_requests[0].qualification_request_id.should == '789RVWYBAZW00EXAMPLE951RVWYBAZW00EXAMPLE'
    response.qualification_requests[0].subject_id.should == 'AZ3456EXAMPLE'
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

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