Sha256: 11c84fe8ba524fcd7d6103aaaf13fb201266abcef039a10d2cc196768defd351

Contents?: true

Size: 1.01 KB

Versions: 35

Compression:

Stored size: 1.01 KB

Contents

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

describe RTurk::RejectAssignment do

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

  it "should ensure required params" do
    lambda{RTurk::RejectAssignment(:assignment_id => "123456789")}.should raise_error RTurk::MissingParameters
  end
  
  it "should successfully request the operation" do
    RTurk::Requester.should_receive(:request).once.with(
      hash_including('Operation' => 'RejectAssignment'))
    RTurk::RejectAssignment(:assignment_id => "123456789", :feedback => "This work of your, it is terrible!") rescue RTurk::InvalidRequest
  end
  
  it "should parse and return the result" do
    RTurk::RejectAssignment(:assignment_id => "123456789", :feedback => "This work of your, it is terrible!").should
      be_a_kind_of RTurk::Response
  end

end

Version data entries

35 entries across 35 versions & 1 rubygems

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