Sha256: 5a012c390fe39d87455da310233e7f3b5eea0881cf281707be9a16e6f294b5ee

Contents?: true

Size: 873 Bytes

Versions: 28

Compression:

Stored size: 873 Bytes

Contents

require 'spec_helper'

describe DiscourseApi::API::PrivateMessages do
  subject { DiscourseApi::Client.new("http://localhost:3000", "test_d7fd0429940", "test_user") }

  describe "#private_messages" do
    before do
      stub_get("http://localhost:3000/topics/private-messages/test_user.json?api_key=test_d7fd0429940&api_username=test_user").to_return(body: fixture("private_messages.json"), headers: { content_type: "application/json" })
    end

    it "requests the correct resource" do
      subject.private_messages('test_user')
      expect(a_get("http://localhost:3000/topics/private-messages/test_user.json?api_key=test_d7fd0429940&api_username=test_user")).to have_been_made
    end

    it "returns the requested private messages" do
      private_messages = subject.private_messages('test_user')
      expect(private_messages).to be_an Array
    end
  end

end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
discourse_api-0.14.1 spec/discourse_api/api/private_messages_spec.rb
discourse_api-0.14.0 spec/discourse_api/api/private_messages_spec.rb
discourse_api-0.13.0 spec/discourse_api/api/private_messages_spec.rb
discourse_api-0.12.0 spec/discourse_api/api/private_messages_spec.rb
discourse_api-0.10.1 spec/discourse_api/api/private_messages_spec.rb
discourse_api-0.10.0 spec/discourse_api/api/private_messages_spec.rb
discourse_api-0.9.1 spec/discourse_api/api/private_messages_spec.rb
discourse_api-0.9.0 spec/discourse_api/api/private_messages_spec.rb
discourse_api-0.8.1 spec/discourse_api/api/private_messages_spec.rb
discourse_api-0.8.0 spec/discourse_api/api/private_messages_spec.rb
discourse_api-0.7.0 spec/discourse_api/api/private_messages_spec.rb
discourse_api-0.6.2 spec/discourse_api/api/private_messages_spec.rb
discourse_api-0.6.1 spec/discourse_api/api/private_messages_spec.rb
discourse_api-0.6.0 spec/discourse_api/api/private_messages_spec.rb
discourse_api-0.5.1 spec/discourse_api/api/private_messages_spec.rb
discourse_api-0.5.0 spec/discourse_api/api/private_messages_spec.rb
discourse_api-0.4.4 spec/discourse_api/api/private_messages_spec.rb
discourse_api-0.4.3 spec/discourse_api/api/private_messages_spec.rb
discourse_api-0.4.2 spec/discourse_api/api/private_messages_spec.rb
discourse_api-0.4.1 spec/discourse_api/api/private_messages_spec.rb