Sha256: 24af7a5b72aa12374082ef82ef16089e38e84ac5c37305b94f4be34a05f39139

Contents?: true

Size: 707 Bytes

Versions: 5

Compression:

Stored size: 707 Bytes

Contents

module Workarea
  module Emarsys
    class BogusGateway
      attr_reader :options

      def initialize(options = {})
        @options = options
      end

      def method_missing(method, *args)
        response
      end

      private

        def response
          response = Faraday.new do |builder|
            builder.adapter :test do |stub|
              stub.get('/rest/bogus.json') { |env| [ 200, {}, response_body ] }
            end
          end
          r = response.get('/rest/bogus.json')
          Response.new(r)
        end

        def response_body
          {
            "data" => {
              "ids" => ['123456']
            }
          }.to_json
        end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
workarea-emarsys-1.0.4 app/lib/workarea/emarsys/bogus_gateway.rb
workarea-emarsys-2.0.1 app/lib/workarea/emarsys/bogus_gateway.rb
workarea-emarsys-2.0.0 app/lib/workarea/emarsys/bogus_gateway.rb
workarea-emarsys-1.1.0 app/lib/workarea/emarsys/bogus_gateway.rb
workarea-emarsys-1.0.3 app/lib/workarea/emarsys/bogus_gateway.rb