Sha256: 3eb7fe5742c5477e138a87f2bdd78607084c4236c9544c083605f1fa1da766f6

Contents?: true

Size: 1.2 KB

Versions: 5

Compression:

Stored size: 1.2 KB

Contents

require 'spec_helper'

require 'shared_examples_for_get_resource.rb'
require 'shared_examples_for_get_resources.rb'
require 'shared_examples_for_post_resource.rb'
require 'shared_examples_for_put_resource.rb'
require 'shared_examples_for_delete_resource.rb'

RSpec.describe OiApi::Client::AutoResponders do

  before do
    Factory.delete_all_advertisers
    Factory.delete_all_offers
    Factory.delete_all_auto_responders
  end

  let(:api) { Factory.api_client }

  let(:offer) { Factory.create_offer }

  context '#all_auto_responders', :vcr do

    before do
      Factory.create_auto_responder
      Factory.create_auto_responder
      Factory.create_auto_responder
    end

    let(:response) { api.all_auto_responders }

    it_should_behave_like 'GET resources', :auto_responder, { expected_num_resources: 3 }

  end

  context '#auto_responders', :vcr do

    before do
      Factory.create_auto_responder(offer_id: offer['id'])
    end

    let(:response) { api.auto_responders(offer['id']) }

    it_should_behave_like 'GET resources', :auto_responder, { expected_num_resources: 1 }

  end

  context '#create_auto_responder', :vcr do
    # TODO
  end

  context '#update_auto_responder', :vcr do
    # TODO
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
oi-api-ruby-0.1.5 spec/oi_api/client/auto_responders_spec.rb
oi-api-ruby-0.1.4 spec/oi_api/client/auto_responders_spec.rb
oi-api-ruby-0.1.3 spec/oi_api/client/auto_responders_spec.rb
oi-api-ruby-0.1.2 spec/oi_api/client/auto_responders_spec.rb
oi-api-ruby-0.1.1 spec/oi_api/client/auto_responders_spec.rb