Sha256: 28be308f8f5509ea644cc148822be5b372247033bf72690d24ed96e1783c4016

Contents?: true

Size: 1003 Bytes

Versions: 6

Compression:

Stored size: 1003 Bytes

Contents

require 'helper'

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

  it "returns all submissions for a course" do
    stub_get(@client, "/api/v1/courses/3/students/submissions").to_return(json_response("submissions.json"))
    submissions = @client.course_submissions(3)
    submissions['assignment_id'].should == 2353405
    submissions['id'].should == 8444510
    submissions['score'].should == 1
    submissions['grade'].should == '1'
    submissions['user_id'].should == 682285
    submissions['workflow_state'].should =='unsubmitted'
    submissions['late'].should == false
    submissions['preview_url'].should =='https://canvas.instructure.com/courses/218274/assignments/2353405/submissions/682285?preview=1'
    submissions['workflow_state'].should =='unsubmitted'
    submissions['workflow_state'].should =='unsubmitted'
    submissions['workflow_state'].should =='unsubmitted'
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
bearcat-0.9.10 spec/bearcat/client/submissions_spec.rb
bearcat-0.9.9 spec/bearcat/client/submissions_spec.rb
bearcat-0.9.8 spec/bearcat/client/submissions_spec.rb
bearcat-0.9.7 spec/bearcat/client/submissions_spec.rb
bearcat-0.9.6 spec/bearcat/client/submissions_spec.rb
bearcat-0.9.5 spec/bearcat/client/submissions_spec.rb