spec/operations/get_assignments_spec.rb in rturk-2.3.3 vs spec/operations/get_assignments_spec.rb in rturk-2.3.4
- old
+ new
@@ -1,9 +1,8 @@
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper'))
describe RTurk::GetAssignmentsForHIT do
-
before(:all) do
aws = YAML.load(File.open(File.join(SPEC_ROOT, 'mturk.yml')))
RTurk.setup(aws['AWSAccessKeyId'], aws['AWSAccessKey'], :sandbox => true)
end
@@ -16,23 +15,21 @@
hash_including('Operation' => 'GetAssignmentsForHIT'))
RTurk::GetAssignmentsForHIT(:hit_id => "abcd") rescue RTurk::InvalidRequest
end
context "an HIT with one assignment" do
-
before(:all) do
FakeWeb.clean_registry
faker('get_assignments', :operation => 'GetAssignmentsForHIT')
end
it "should parse and return and answer" do
assignments = RTurk::GetAssignmentsForHIT(:hit_id => "abcd").assignments
assignments.first.answers['tweet'].should eql("This is my tweet!")
end
-
end
-
+
context "an HIT with multiple assignment" do
before(:all) do
FakeWeb.clean_registry
faker('get_assignments_multiple', :operation => 'GetAssignmentsForHIT')
@@ -40,9 +37,7 @@
it "should parse and return and answer" do
assignments = RTurk::GetAssignmentsForHIT(:hit_id => "abcd").assignments
assignments.first.answers['tweet'].should eql("This is my tweet!")
end
-
end
-
end