Sha256: a87599fd8adb8d2b9304b659e840e2834b3aa2033c35d9cdccb595290c1bc817

Contents?: true

Size: 970 Bytes

Versions: 2

Compression:

Stored size: 970 Bytes

Contents

require 'helper'

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

  it "returns all assignment groups for a course" do
    stub_get(@client, "/api/v1/courses/1/assignment_groups").to_return(json_response("assignment_groups.json"))
    assignment_groups = @client.list_assignment_groups(1)
    assignment_groups.count.should == 2
    assignment_groups.first["group_weight"].should == 500
    assignment_groups.first["id"].should == 2
    assignment_groups.first["name"].should == 'Quizzes'
  end

  it 'returns a signle assignment_group' do
    stub_get(@client, '/api/v1/courses/2/assignment_groups/1').to_return(json_response("assignment_group.json"))
    assignment_group = @client.assignment_group(2, 1)
    assignment_group["group_weight"].should == 500
    assignment_group["id"].should == 2
    assignment_group["name"].should == 'Quizzes'
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
bearcat-1.3.3 spec/bearcat/client/assignment_groups_spec.rb
bearcat-1.3.2 spec/bearcat/client/assignment_groups_spec.rb