Sha256: 02f8376cfe3ce9fdc86e57e43d98ccb4e36ea1b7737e50a63c314634de51b468

Contents?: true

Size: 1 KB

Versions: 11

Compression:

Stored size: 1 KB

Contents

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

describe RTurk::ApproveRejectedAssignment do

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

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

  it "should successfully request the operation" do
    RTurk::Requester.should_receive(:request).once.with(
      hash_including('Operation' => 'ApproveRejectedAssignment'))
    RTurk::ApproveRejectedAssignment(:assignment_id => "123456789") rescue RTurk::InvalidRequest
  end

  it "should parse and return the result" do
    RTurk::ApproveRejectedAssignment(:assignment_id => "123456789").elements.should eql(
      {"ApproveRejectedAssignmentResult"=>{"Request"=>{"IsValid"=>"True"}}}
    )
  end

end

Version data entries

11 entries across 11 versions & 1 rubygems

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