Sha256: e48c6fc3e08eb2c5001e8f4a3397e6b87f40742622d9bb96d0f0e20e8a3910a5

Contents?: true

Size: 747 Bytes

Versions: 16

Compression:

Stored size: 747 Bytes

Contents

require 'helper'

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

  it 'returns all items for a module' do
    stub_get(@client, '/api/v1/courses/1/modules/1/items').to_return(json_response('module_items.json'))
    items = @client.list_module_items(1,1)
    items.count.should == 3
    items.members[0]['id'].should == 1358
    items.members[0]['type'].should == 'Page'
  end

  describe '#module_item' do
    it 'returns a module' do
      stub_get(@client, '/api/v1/courses/1/modules/1/items/2').to_return(json_response('module_item.json'))
      item = @client.module_item(1, 1, 2)
      expect(item['id']).to eq(2)
    end
  end

end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
bearcat-1.3.39 spec/bearcat/client/module_items_spec.rb
bearcat-1.3.38 spec/bearcat/client/module_items_spec.rb
bearcat-1.3.37 spec/bearcat/client/module_items_spec.rb
bearcat-1.3.36 spec/bearcat/client/module_items_spec.rb
bearcat-1.3.35 spec/bearcat/client/module_items_spec.rb
bearcat-1.3.34 spec/bearcat/client/module_items_spec.rb
bearcat-1.3.33 spec/bearcat/client/module_items_spec.rb
bearcat-1.3.32 spec/bearcat/client/module_items_spec.rb
bearcat-1.3.30 spec/bearcat/client/module_items_spec.rb
bearcat-1.3.28 spec/bearcat/client/module_items_spec.rb
bearcat-1.3.27 spec/bearcat/client/module_items_spec.rb
bearcat-1.3.26 spec/bearcat/client/module_items_spec.rb
bearcat-1.3.25 spec/bearcat/client/module_items_spec.rb
bearcat-1.3.24 spec/bearcat/client/module_items_spec.rb
bearcat-1.3.23 spec/bearcat/client/module_items_spec.rb
bearcat-1.3.22 spec/bearcat/client/module_items_spec.rb