spec/bearcat/client/assignments_spec.rb in bearcat-1.3.22 vs spec/bearcat/client/assignments_spec.rb in bearcat-1.3.23

- old
+ new

@@ -48,6 +48,30 @@ stub_delete(@client, "/api/v1/courses/3/assignments/1").to_return(json_response("assignment.json")) assignment = @client.delete_assignment(3, 1) assignment["id"].should == 1 end + it "allows batch retrieval of all overrides in a course" do + stub_get(@client, "/api/v1/courses/3/assignments/overrides").to_return(json_response("assignment_section_override.json")) + @client.all_assignment_overrides(3) + end + + it "allows batch creation of assignment overrides" do + stub_post(@client, "/api/v1/courses/310/assignments/overrides") + .with(:body => {"assignment_override"=>{"course_section_id"=>"74", "due_at"=>"2013-06-27T21:08:46Z"}}) + .to_return(json_response("assignment_section_override.json")) + @client.batch_create_assignment_overrides(310, { + "assignment_override[course_section_id]" => 74, + "assignment_override[due_at]" => "2013-06-27T21:08:46Z" + }) + end + + it "allows batch updating of assignment overrides" do + stub_put(@client, "/api/v1/courses/310/assignments/overrides") + .with(:body => {"assignment_override"=>{"course_section_id"=>"74", "due_at"=>"2013-06-27T21:08:46Z"}}) + .to_return(json_response("assignment_section_override.json")) + @client.batch_update_assignment_overrides(310, { + "assignment_override[course_section_id]" => 74, + "assignment_override[due_at]" => "2013-06-27T21:08:46Z" + }) + end end