Sha256: 7555c9e494bd1cabd26c6ba3b98eaa2473c7da99f89b760538c6666e707a87bc

Contents?: true

Size: 828 Bytes

Versions: 44

Compression:

Stored size: 828 Bytes

Contents

require 'spec_helper'

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

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

    it "requests the correct resource" do
      subject.backups
      expect(a_get("http://localhost:3000/admin/backups.json?api_key=test_d7fd0429940&api_username=test_user")).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

44 entries across 44 versions & 1 rubygems

Version Path
discourse_api-0.4.2 spec/discourse_api/api/backups_spec.rb
discourse_api-0.4.1 spec/discourse_api/api/backups_spec.rb
discourse_api-0.4.0 spec/discourse_api/api/backups_spec.rb
discourse_api-0.3.6 spec/discourse_api/api/backups_spec.rb