Sha256: 0266e8c645d5b7fc88eb85fbd8e5744addb8923d7e59f9c002d181bf206900c4
Contents?: true
Size: 939 Bytes
Versions: 162
Compression:
Stored size: 939 Bytes
Contents
require 'helper' describe Bearcat::Client::Conversations do before do @client = Bearcat::Client.new(prefix: "http://canvas.instructure.com", token: "test_token") end context 'POST' do it "creates a conversation" do body = {recipients: %w(1), body: 'testing'} stub_post(@client, "/api/v1/conversations").with(body: body).to_return(json_response("conversation.json")) conversation = @client.create_conversation(body) message = conversation.first['messages'] message.count.should == 1 message.first['body'].should == 'testing' end end context 'DELETE' do it "deletes a conversation" do stub_delete(@client, "/api/v1/conversations/1").to_return(json_response("deleted_conversation.json")) deleted_conversation = @client.delete_conversation("1") deleted_conversation["id"].should == 1 deleted_conversation["message_count"].should == 0 end end end
Version data entries
162 entries across 162 versions & 1 rubygems