Sha256: 772631d949761d25c1920cc3f05dc448eff02a3b8207e37dc8f78055b05dbeae
Contents?: true
Size: 814 Bytes
Versions: 17
Compression:
Stored size: 814 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/self/roles' do json_response 200, 'roles.json' end get '/api/v1/accounts/self/admins' do json_response 200, 'admins.json' end get '/sample_report_download' do json_response 200, 'terms.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
17 entries across 17 versions & 1 rubygems