Sha256: 3276acfc4ce40ea45ba7d085bf1a986b19b0cb0bdddcdd8283f2792230d6c734

Contents?: true

Size: 764 Bytes

Versions: 2

Compression:

Stored size: 764 Bytes

Contents

# frozen_string_literal: true
require "spec_helper"

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

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

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

    it "returns the requested backups" do
      backups = subject.backups
      expect(backups).to be_an Array
      expect(backups.first).to be_a Hash
      expect(backups.first).to have_key("filename")
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
discourse_api-2.0.1 spec/discourse_api/api/backups_spec.rb
discourse_api-2.0.0 spec/discourse_api/api/backups_spec.rb