Sha256: 8aafe57293901e1bfc21091a45f73fb7d34c591d384dea9b156f32c9c93026d9

Contents?: true

Size: 963 Bytes

Versions: 35

Compression:

Stored size: 963 Bytes

Contents

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

describe RTurk::ApproveAssignment 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_assignment', :operation => 'ApproveAssignment')
  end

  it "should ensure required params" do
    lambda{RTurk::ApproveAssignment()}.should raise_error RTurk::MissingParameters
  end
  
  it "should successfully request the operation" do
    RTurk::Requester.should_receive(:request).once.with(
      hash_including('Operation' => 'ApproveAssignment'))
    RTurk::ApproveAssignment(:assignment_id => "123456789") rescue RTurk::InvalidRequest
  end
  
  it "should parse and return the result" do
    RTurk::ApproveAssignment(:assignment_id => "123456789").elements.should eql(
      {"ApproveAssignmentResult"=>{"Request"=>{"IsValid"=>"True"}}}
    )
  end

end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
rturk-2.3.4 spec/operations/approve_assignment_spec.rb
rturk-2.3.3 spec/operations/approve_assignment_spec.rb
rturk-2.3.2 spec/operations/approve_assignment_spec.rb
rturk-2.3.1 spec/operations/approve_assignment_spec.rb
rturk-2.3.0 spec/operations/approve_assignment_spec.rb
rturk-2.2.1 spec/operations/approve_assignment_spec.rb
rturk-2.2.0 spec/operations/approve_assignment_spec.rb
rturk-2.1.1 spec/operations/approve_assignment_spec.rb
rturk-2.1.0 spec/operations/approve_assignment_spec.rb
rturk-2.0.5 spec/operations/approve_assignment_spec.rb
rturk-2.0.4 spec/operations/approve_assignment_spec.rb
rturk-2.0.3 spec/operations/approve_assignment_spec.rb
rturk-2.0.2 spec/operations/approve_assignment_spec.rb
rturk-2.0.1 spec/operations/approve_assignment_spec.rb
rturk-2.0.0 spec/operations/approve_assignment_spec.rb