Permalink
Browse files

Adding IntegerValue attribute to AssignQualification

  • Loading branch information...
1 parent 4190323 commit 4e5215f8816104bb02fb76cebeacedf51980eda8 Ross Hale committed Feb 11, 2012
Showing with 8 additions and 5 deletions.
  1. +3 −2 lib/rturk/operations/assign_qualification.rb
  2. +5 −3 spec/operations/assign_qualification_spec.rb
@@ -2,13 +2,14 @@
module RTurk
class AssignQualification < Operation
- attr_accessor :qualification_type_id, :worker_id, :send_notification
+ attr_accessor :qualification_type_id, :worker_id, :send_notification, :integer_value
require_params :qualification_type_id, :worker_id
def to_params
{'QualificationTypeId' => qualification_type_id,
'WorkerId' => worker_id,
- 'SendNotification' => (!!send_notification).to_s}
+ 'SendNotification' => (!!send_notification).to_s,
+ 'IntegerValue' => integer_value}
end
end
@@ -13,14 +13,16 @@
it "should successfully request the operation" do
RTurk::Requester.should_receive(:request).once.with(
- hash_including('Operation' => 'AssignQualification'))
+ hash_including('Operation' => 'AssignQualification', 'IntegerValue' => 80))
RTurk::AssignQualification(:qualification_type_id => "123456789",
- :worker_id => "ABCDEF1234") rescue RTurk::InvalidRequest
+ :worker_id => "ABCDEF1234",
+ :integer_value => 80) rescue RTurk::InvalidRequest
end
it "should parse and return the result" do
RTurk::AssignQualification(:qualification_type_id => "123456789",
- :worker_id => "ABCDEF1234").elements.should eql(
+ :worker_id => "ABCDEF1234",
+ :integer_value => 80).elements.should eql(
{"AssignQualificationResult"=>{"Request"=>{"IsValid"=>"True"}}}
)
end

0 comments on commit 4e5215f

Please sign in to comment.