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.33.0 spec/discourse_api/api/backups_spec.rb
discourse_api-0.32.0 spec/discourse_api/api/backups_spec.rb
discourse_api-0.31.0 spec/discourse_api/api/backups_spec.rb
discourse_api-0.30.0 spec/discourse_api/api/backups_spec.rb
discourse_api-0.29.0 spec/discourse_api/api/backups_spec.rb
discourse_api-0.28.1 spec/discourse_api/api/backups_spec.rb
discourse_api-0.28.0 spec/discourse_api/api/backups_spec.rb
discourse_api-0.27.0 spec/discourse_api/api/backups_spec.rb
discourse_api-0.26.0 spec/discourse_api/api/backups_spec.rb
discourse_api-0.25.0 spec/discourse_api/api/backups_spec.rb
discourse_api-0.24.0 spec/discourse_api/api/backups_spec.rb
discourse_api-0.23.1 spec/discourse_api/api/backups_spec.rb
discourse_api-0.23.0 spec/discourse_api/api/backups_spec.rb
discourse_api-0.22.0 spec/discourse_api/api/backups_spec.rb
discourse_api-0.20.1 spec/discourse_api/api/backups_spec.rb
discourse_api-0.20.0 spec/discourse_api/api/backups_spec.rb
discourse_api-0.19.0 spec/discourse_api/api/backups_spec.rb
discourse_api-0.18.0 spec/discourse_api/api/backups_spec.rb
discourse_api-0.17.0 spec/discourse_api/api/backups_spec.rb
discourse_api-0.16.1 spec/discourse_api/api/backups_spec.rb