Sha256: 0d818dca85063d052f9b7e6b6b166a989dd8a034264f014003f714e91e55f873

Contents?: true

Size: 785 Bytes

Versions: 14

Compression:

Stored size: 785 Bytes

Contents

# frozen_string_literal: true
require 'spec_helper'

describe DiscourseApi::API::Notifications do
  subject { DiscourseApi::Client.new("#{host}", "test_d7fd0429940", "test_user") }

  describe "#notifications" do

    before do
      stub_get("#{host}/notifications.json").to_return(body: fixture("notifications.json"), headers: { content_type: "application/json" })
    end

    it "requests the correct resource" do
      subject.notifications
      expect(a_get("#{host}/notifications.json")).to have_been_made
    end

    it "returns the requested notifications" do
      notifications = subject.notifications
      expect(notifications).to be_an Array
      expect(notifications.first).to be_an Hash
      expect(notifications[0]['notification_type']).to eq(9)
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
discourse_api-1.1.0 spec/discourse_api/api/notifications_spec.rb
discourse_api-1.0.0 spec/discourse_api/api/notifications_spec.rb
discourse_api-0.48.1 spec/discourse_api/api/notifications_spec.rb
discourse_api-0.48.0 spec/discourse_api/api/notifications_spec.rb
discourse_api-0.47.0 spec/discourse_api/api/notifications_spec.rb
discourse_api-0.46.0 spec/discourse_api/api/notifications_spec.rb
discourse_api-0.45.1 spec/discourse_api/api/notifications_spec.rb
discourse_api-0.45.0 spec/discourse_api/api/notifications_spec.rb
discourse_api-0.44.0 spec/discourse_api/api/notifications_spec.rb
discourse_api-0.43.1 spec/discourse_api/api/notifications_spec.rb
discourse_api-0.43.0 spec/discourse_api/api/notifications_spec.rb
discourse_api-0.42.0 spec/discourse_api/api/notifications_spec.rb
discourse_api-0.41.0 spec/discourse_api/api/notifications_spec.rb
discourse_api-0.40.0 spec/discourse_api/api/notifications_spec.rb