Sha256: 01d4b46788ffcf706083dff5e4cd1ec846c2c43c8dcaff6d772c277acf0f99a3

Contents?: true

Size: 836 Bytes

Versions: 1

Compression:

Stored size: 836 Bytes

Contents

require 'spec_helper'
require 'routemaster/resources/rest_resource'

module Routemaster
  module Resources
    RSpec.describe RestResource do
      let(:url) { 'test_url' }
      let(:client) { double('Client') }
      let(:params) { {} }

      subject { described_class.new(url, client: client) }

      describe '#create' do
        it 'posts to the given url' do
          expect(client).to receive(:post).with(url, body: params)
          subject.create(params)
        end
      end

      describe '#show' do
        it 'gets to the given url' do
          expect(client).to receive(:get).with(url)
          subject.show(1)
        end
      end

      describe '#index' do
        it 'gets to the given url' do
          expect(client).to receive(:get).with(url)
          subject.index
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
routemaster-drain-2.0.0 spec/routemaster/resources/rest_resource_spec.rb