Sha256: 9fc1cbd3292af1ae31f6df068126bd8731fbe934f576da63c95608afd7221dba

Contents?: true

Size: 930 Bytes

Versions: 6

Compression:

Stored size: 930 Bytes

Contents

require 'helper'

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

  it "creates a new group discussion" do
    title = "This is a group discussion"
    stub_post(@client, "/api/v1/groups/2/discussion_topics").with(body: {"title" => title}).to_return(json_response("create_group_discussion.json"))
    discussion = @client.create_group_discussion(2, {'title' => title})
    discussion['title'].should == 'This is a group discussion'
  end

  it 'creates a new course discussion' do
    title = "This is a course discussion"
    stub_post(@client, "/api/v1/courses/2/discussion_topics").with(body: {"title" => title}).to_return(json_response("create_course_discussion.json"))
    discussion = @client.create_course_discussion(2, {'title' => title})
    discussion['title'].should == 'This is a course discussion'
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
bearcat-1.2.13 spec/bearcat/client/discussions_spec.rb
bearcat-1.2.12 spec/bearcat/client/discussions_spec.rb
bearcat-1.2.11 spec/bearcat/client/discussions_spec.rb
bearcat-1.2.10 spec/bearcat/client/discussions_spec.rb
bearcat-1.2.9 spec/bearcat/client/discussions_spec.rb
bearcat-1.2.7 spec/bearcat/client/discussions_spec.rb