Sha256: e4305c273d7cf8ed61a223ae344d438339530d265c3047bfa826babc3c241ff7
Contents?: true
Size: 1.17 KB
Versions: 30
Compression:
Stored size: 1.17 KB
Contents
require 'helper' describe Bearcat::Client::Quizzes do before do @client = Bearcat::Client.new(prefix: "http://canvas.instructure.com", token: "test_token") end it "returns a courses quizzes" do stub_get(@client, "/api/v1/courses/1/quizzes").to_return(json_response("quizzes/course_quizzes.json")) course_quizzes = @client.list_course_quizzes('1') course_quizzes.class.should eq(Bearcat::ApiArray) course_quizzes.count.should == 2 course_quizzes.first['id'].should == 37 course_quizzes.last['id'].should == 38 end it "returns a single quiz" do stub_get(@client, "/api/v1/courses/1/quizzes/38").to_return(json_response("quizzes/course_quiz.json")) course_quiz = @client.quiz('1', '38') course_quiz.class.should eq(Hash) course_quiz['id'].should == 38 end it 'sets extensions on a quiz' do stub_post(@client, "/api/v1/courses/1/quizzes/1/extensions").to_return(json_response("quizzes/quiz_extension.json")) quiz_extension = @client.quiz_extensions('1', '1', {quiz_extensions: [{user_id: 1}, {extra_time: 30}]}) quiz_extension.class.should eq(Hash) quiz_extension['quiz_extensions'].first['extra_time'].should eq(30) end end
Version data entries
30 entries across 30 versions & 1 rubygems