Sha256: 4a3a9d3b40ce76371600b66d54e030313893abff5e76d8d80f58d86c7bef00f2
Contents?: true
Size: 987 Bytes
Versions: 138
Compression:
Stored size: 987 Bytes
Contents
require 'sinatra/base' # Canvas responses can be mocked out here. You can get the correct # format by hitting a real Canvas API for the route you're looking at, # and then save the result as a .json file in spec/support/fixtures/canvas_responses class FakeCanvas < Sinatra::Base get '/api/v1/accounts/self/terms' do json_response 200, 'terms.json' end get '/api/v1/accounts/1/roles' do json_response 200, 'roles.json' end get '/api/v1/accounts/1/admins' do json_response 200, 'admins.json' end get '/sample_report_download' do json_response 200, 'terms.json' end get '/api/v1/courses/1/modules/1' do json_response 200, 'module.json' end get '/api/v1/courses/1/modules/1/items/1' do json_response 200, 'module_item.json' end private def json_response(response_code, file_name) content_type :json status response_code File.open(File.dirname(__FILE__) + '/fixtures/canvas_responses/' + file_name, 'rb').read end end
Version data entries
138 entries across 138 versions & 1 rubygems