Sha256: 730ce077c30b039f008076e7f9a136a34bb2e5d8e5fe9f8ef7f2fb175809fa8c
Contents?: true
Size: 1.16 KB
Versions: 4
Compression:
Stored size: 1.16 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/quiz_extensions").to_return(json_response("quizzes/quiz_extension.json")) quiz_extension = @client.quiz_extensions('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
4 entries across 4 versions & 1 rubygems