Sha256: a9b662d626acf659c391c0ceb2fe3cf7ea21768b3671dcbb18244ad13fca35b9

Contents?: true

Size: 833 Bytes

Versions: 79

Compression:

Stored size: 833 Bytes

Contents

require 'helper'

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

  it "returns course modules" do
    stub_get(@client, "/api/v1/courses/1/modules").to_return(json_response("modules.json"))
    modules = @client.course_modules(1)
    modules.count.should == 3
    modules.first['id'].should == 1
  end

  it "returns a course items module sequence" do
    query = {"asset_type" => "assignment", "asset_id" => '22'}
    stub_get(@client, "/api/v1/courses/1/module_item_sequence").with(query: query).to_return(json_response("module_item_sequence.json"))
    item_sequence = @client.course_module_item_sequence("1", query)
    items = item_sequence["modules"]
    items.count.should == 3
    items.last["id"].should == 3
  end

end

Version data entries

79 entries across 79 versions & 1 rubygems

Version Path
bearcat-1.0.28 spec/bearcat/client/modules_spec.rb
bearcat-1.0.27 spec/bearcat/client/modules_spec.rb
bearcat-1.0.26 spec/bearcat/client/modules_spec.rb
bearcat-1.0.25 spec/bearcat/client/modules_spec.rb
bearcat-1.0.24 spec/bearcat/client/modules_spec.rb
bearcat-1.0.23 spec/bearcat/client/modules_spec.rb
bearcat-1.0.22 spec/bearcat/client/modules_spec.rb
bearcat-1.0.21 spec/bearcat/client/modules_spec.rb
bearcat-1.0.20 spec/bearcat/client/modules_spec.rb
bearcat-1.0.19 spec/bearcat/client/modules_spec.rb
bearcat-1.0.18 spec/bearcat/client/modules_spec.rb
bearcat-1.0.17 spec/bearcat/client/modules_spec.rb
bearcat-1.0.16 spec/bearcat/client/modules_spec.rb
bearcat-1.0.15 spec/bearcat/client/modules_spec.rb
bearcat-1.0.14 spec/bearcat/client/modules_spec.rb
bearcat-1.0.13 spec/bearcat/client/modules_spec.rb
bearcat-1.0.12 spec/bearcat/client/modules_spec.rb
bearcat-1.0.11 spec/bearcat/client/modules_spec.rb
bearcat-1.0.10 spec/bearcat/client/modules_spec.rb
bearcat-1.0.9 spec/bearcat/client/modules_spec.rb