Sha256: 0bc2f35e98c5edcea4a72d29f79074f067146b38e74bc7bff795db2634ba3243

Contents?: true

Size: 720 Bytes

Versions: 14

Compression:

Stored size: 720 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

14 entries across 14 versions & 1 rubygems

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