Sha256: a980bce4ce8ca000d46a44eed8dd2b1d9a19a27b9e3624a897899ba7ec96f728

Contents?: true

Size: 847 Bytes

Versions: 4

Compression:

Stored size: 847 Bytes

Contents

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

describe RTurk::DisableHIT do

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

  it "should ensure required params" do
    lambda{RTurk::DisableHIT()}.should raise_error RTurk::MissingParameters
  end
  
  it "should successfully request the operation" do
    RTurk::Requester.should_receive(:request).once.with(
      hash_including('Operation' => 'DisableHIT'))
    RTurk::DisableHIT(:hit_id => "123456789") rescue RTurk::InvalidRequest
  end
  
  it "should parse and return the result" do
    RTurk::DisableHIT(:hit_id => "123456789").should
      be_a_kind_of RTurk::Response
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rturk-2.0.3 spec/operations/disable_hit_spec.rb
rturk-2.0.2 spec/operations/disable_hit_spec.rb
rturk-2.0.1 spec/operations/disable_hit_spec.rb
rturk-2.0.0 spec/operations/disable_hit_spec.rb