Sha256: fedf50fd450d2d4299255a6a73ccc8a841f748e0b33f9a1fb0e57d5abd4a9d3e

Contents?: true

Size: 1.67 KB

Versions: 72

Compression:

Stored size: 1.67 KB

Contents

require 'helper'

describe Bearcat::Client::RubricAssessment do
  before do
    @client = Bearcat::Client.new(prefix:"http://canvas.instructure.com", token: "test_token")
  end

  it "creates a rubric assessment" do
    stub_post(@client, "/api/v1/courses/72/rubric_associations/4/rubric_assessments")
      .with(:body => {
        "rubric_assessment"=>{
          "user_id"=>"22",
          "assessor_id"=>"1"
        }
      }).to_return(json_response("rubric_assessment.json"))
    rubric = @client.create_course_rubric_assessment(72, 4,
      {"rubric_assessment[user_id]" => "22", "rubric_assessment[assessor_id]" => "1"})
    rubric['id'].should == 5
    rubric['assessor_id'].should == 1
    rubric['user_id'].should == 22
  end

  it "updates a rubric assessment" do
    stub_put(@client, "/api/v1/courses/72/rubric_associations/4/rubric_assessments/5")
      .with(:body => {
        "rubric_assessment"=>{
          "user_id"=>"22",
          "assessor_id"=>"1"
        }
      }).to_return(json_response("rubric_assessment.json"))
    rubric = @client.update_course_rubric_assessment(72, 4, 5,
      {"rubric_assessment[user_id]" => "22", "rubric_assessment[assessor_id]" => "1"})
    rubric['id'].should == 5
    rubric['assessor_id'].should == 1
    rubric['user_id'].should == 22
  end

  it "deletes a rubric assessment" do
    stub_delete(@client, "/api/v1/courses/72/rubric_associations/4/rubric_assessments/5")
      .to_return(json_response("rubric_assessment.json"))
    rubric_assessment = @client.delete_course_rubric_assessment(72, 4, 5)
    rubric_assessment['id'].should == 5
    rubric_assessment['assessor_id'].should == 1
    rubric_assessment['user_id'].should == 22
  end

end

Version data entries

72 entries across 72 versions & 1 rubygems

Version Path
bearcat-1.4.10 spec/bearcat/client/rubric_assessment_spec.rb
bearcat-1.4.9 spec/bearcat/client/rubric_assessment_spec.rb
bearcat-1.4.8 spec/bearcat/client/rubric_assessment_spec.rb
bearcat-1.4.7 spec/bearcat/client/rubric_assessment_spec.rb
bearcat-1.4.6 spec/bearcat/client/rubric_assessment_spec.rb
bearcat-1.4.5 spec/bearcat/client/rubric_assessment_spec.rb
bearcat-1.4.4 spec/bearcat/client/rubric_assessment_spec.rb
bearcat-1.4.3 spec/bearcat/client/rubric_assessment_spec.rb
bearcat-1.4.2 spec/bearcat/client/rubric_assessment_spec.rb
bearcat-1.4.1 spec/bearcat/client/rubric_assessment_spec.rb
bearcat-1.4.0 spec/bearcat/client/rubric_assessment_spec.rb
bearcat-1.3.55 spec/bearcat/client/rubric_assessment_spec.rb
bearcat-1.3.53 spec/bearcat/client/rubric_assessment_spec.rb
bearcat-1.3.52 spec/bearcat/client/rubric_assessment_spec.rb
bearcat-1.3.51 spec/bearcat/client/rubric_assessment_spec.rb
bearcat-1.3.49 spec/bearcat/client/rubric_assessment_spec.rb
bearcat-1.3.48 spec/bearcat/client/rubric_assessment_spec.rb
bearcat-1.3.47 spec/bearcat/client/rubric_assessment_spec.rb
bearcat-1.3.46 spec/bearcat/client/rubric_assessment_spec.rb
bearcat-1.3.45 spec/bearcat/client/rubric_assessment_spec.rb