Sha256: b2bdf24d516a6d816321db040a62496b21685bff8cfacb89c67bb6a10ed8aaae

Contents?: true

Size: 1010 Bytes

Versions: 175

Compression:

Stored size: 1010 Bytes

Contents

require 'helper'

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

  it "returns an outcome" do
    stub_get(@client, "/api/v1/outcomes/1").to_return(json_response("outcomes.json"))
    outcome = @client.show_outcome(1)
    outcome['title'].should == 'Test Outcome title'
    outcome['id'].should == 1
    outcome['description'].should == 'Test Outcome description'
    outcome['points_possible'].should == 5
    outcome['mastery_points'].should == 3
  end

  it "updates an outcome" do
    title = 'updated outcome title'
    description = 'updated outcome desc'
    stub_put(@client, "/api/v1/outcomes/5").with(:body => {"title" => title, "description" => description}).to_return(json_response("update_outcome.json"))
    outcome = @client.update_outcome(5, {"title" => title, "description" => description})
    outcome['title'].should == title
    outcome['description'].should == description
  end

end

Version data entries

175 entries across 175 versions & 1 rubygems

Version Path
bearcat-1.5.37 spec/bearcat/client/outcomes_spec.rb
bearcat-1.5.36 spec/bearcat/client/outcomes_spec.rb
bearcat-1.5.35 spec/bearcat/client/outcomes_spec.rb
bearcat-1.5.34 spec/bearcat/client/outcomes_spec.rb
bearcat-1.5.33 spec/bearcat/client/outcomes_spec.rb
bearcat-1.5.32 spec/bearcat/client/outcomes_spec.rb
bearcat-1.5.31 spec/bearcat/client/outcomes_spec.rb
bearcat-1.5.30 spec/bearcat/client/outcomes_spec.rb
bearcat-1.5.29 spec/bearcat/client/outcomes_spec.rb
bearcat-1.5.28 spec/bearcat/client/outcomes_spec.rb
bearcat-1.5.28.beta1 spec/bearcat/client/outcomes_spec.rb
bearcat-1.5.26 spec/bearcat/client/outcomes_spec.rb
bearcat-1.5.24 spec/bearcat/client/outcomes_spec.rb
bearcat-1.5.23 spec/bearcat/client/outcomes_spec.rb
bearcat-1.5.20 spec/bearcat/client/outcomes_spec.rb
bearcat-1.5.19 spec/bearcat/client/outcomes_spec.rb
bearcat-1.5.17 spec/bearcat/client/outcomes_spec.rb
bearcat-1.5.16 spec/bearcat/client/outcomes_spec.rb
bearcat-1.5.15 spec/bearcat/client/outcomes_spec.rb
bearcat-1.5.14 spec/bearcat/client/outcomes_spec.rb