Sha256: 85d93376ad19c2f9051ce90bd8c77df63d07ed97d60dacb85a5e6c944220fce3

Contents?: true

Size: 797 Bytes

Versions: 53

Compression:

Stored size: 797 Bytes

Contents

class Ey::Core::Client
  class Real
    def destroy_provider(id)
      request(
        :method => :delete,
        :path   => "/providers/#{id}",
      )
    end
  end

  class Mock
    def destroy_provider(id)
      provider   = self.data[:providers][id].dup
      request_id = self.uuid

      provider["cancelled_at"] = Time.now
      provider["resource_url"] = url_for("/providers/#{id}")

      self.data[:requests][request_id] = {
        "id"          => request_id,
        "finished_at" => nil,
        "successful"  => "true",
        "started_at"  => Time.now,
        "resource"    => [:providers, id, provider],
        "type"        => "cancel_provider",
      }

      response(
        :body   => {"request" => {id: request_id}},
        :status => 201,
      )
    end
  end
end

Version data entries

53 entries across 53 versions & 3 rubygems

Version Path
ey-core-3.6.4 lib/ey-core/requests/destroy_provider.rb
ey-core-3.6.3 lib/ey-core/requests/destroy_provider.rb
ey-core-3.6.1 lib/ey-core/requests/destroy_provider.rb
groove-ey-core-3.6.3 lib/ey-core/requests/destroy_provider.rb
groove-ey-core-3.6.2 lib/ey-core/requests/destroy_provider.rb
groove-ey-core-3.6.1 lib/ey-core/requests/destroy_provider.rb
ey-core-3.5.0 lib/ey-core/requests/destroy_provider.rb
ey-core-3.4.4 lib/ey-core/requests/destroy_provider.rb
ey-core-3.4.2 lib/ey-core/requests/destroy_provider.rb
ey-core-3.4.1 lib/ey-core/requests/destroy_provider.rb
ey-core-3.4.0 lib/ey-core/requests/destroy_provider.rb
ey-core-3.3.1 lib/ey-core/requests/destroy_provider.rb
ey-core-3.3.0 lib/ey-core/requests/destroy_provider.rb
ey-core-3.2.6 lib/ey-core/requests/destroy_provider.rb
ey-core-3.2.5 lib/ey-core/requests/destroy_provider.rb
ey-core-3.2.4 lib/ey-core/requests/destroy_provider.rb
ey-core-3.2.3 lib/ey-core/requests/destroy_provider.rb
ey-core-3.2.2 lib/ey-core/requests/destroy_provider.rb
ey-core-3.2.1 lib/ey-core/requests/destroy_provider.rb
ey-core-3.2.0 lib/ey-core/requests/destroy_provider.rb