Sha256: 99bf40a43f3383bcd15e02983ee6a7ef14fb9a3ad6cda0ffe72df15bf9b53168

Contents?: true

Size: 606 Bytes

Versions: 9

Compression:

Stored size: 606 Bytes

Contents

class Zendesk2::Client
  class Real
    def get_organization_by_external_id(external_id)
      request(
        :method => :get,
        :params => { external_id: external_id },
        :path   => "/organizations/search.json",
      )
    end
  end # Real

  class Mock
    def get_organization_by_external_id(external_id)
      collection = self.data[:organizations]

      results = collection.select { |k,v| v["external_id"].to_s == external_id.to_s }.values

      response(
        :path => "/organizations/search.json",
        :body => {"organizations" => results},
      )
    end
  end # Mock
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
zendesk2-1.4.2 lib/zendesk2/client/requests/get_organization_by_external_id.rb
zendesk2-1.4.1 lib/zendesk2/client/requests/get_organization_by_external_id.rb
zendesk2-1.4.0 lib/zendesk2/client/requests/get_organization_by_external_id.rb
zendesk2-1.3.3 lib/zendesk2/client/requests/get_organization_by_external_id.rb
zendesk2-1.3.2 lib/zendesk2/client/requests/get_organization_by_external_id.rb
zendesk2-1.3.1 lib/zendesk2/client/requests/get_organization_by_external_id.rb
zendesk2-1.3.0 lib/zendesk2/client/requests/get_organization_by_external_id.rb
zendesk2-1.2.10 lib/zendesk2/client/requests/get_organization_by_external_id.rb
zendesk2-1.2.9 lib/zendesk2/client/requests/get_organization_by_external_id.rb