Sha256: 9dc0eccd52385db7eaf824b8078b0330d34191bb61d4622b7e80ccbdd2168558

Contents?: true

Size: 788 Bytes

Versions: 43

Compression:

Stored size: 788 Bytes

Contents

class Zendesk2::Client
  class Real
    def create_group(params={})
      request(
        :body   => {"group" => params},
        :method => :post,
        :path   => "/groups.json",
      )
    end
  end # Real

  class Mock
    def create_group(params={})
      identity = self.class.new_id

      record = {
        "id"               => identity,
        "url"              => url_for("/groups/#{identity}.json"),
        "created_at"       => Time.now.iso8601,
        "updated_at"       => Time.now.iso8601,
        "deleted"          => false,
      }.merge(params)

      self.data[:groups][identity] = record

      response(
        :method => :post,
        :body   => {"group" => record},
        :path   => "/groups.json"
      )
    end
  end # Mock
end # Zendesk2::Client

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
zendesk2-1.4.2 lib/zendesk2/client/requests/create_group.rb
zendesk2-1.4.1 lib/zendesk2/client/requests/create_group.rb
zendesk2-1.4.0 lib/zendesk2/client/requests/create_group.rb
zendesk2-1.3.3 lib/zendesk2/client/requests/create_group.rb
zendesk2-1.3.2 lib/zendesk2/client/requests/create_group.rb
zendesk2-1.3.1 lib/zendesk2/client/requests/create_group.rb
zendesk2-1.3.0 lib/zendesk2/client/requests/create_group.rb
zendesk2-1.2.10 lib/zendesk2/client/requests/create_group.rb
zendesk2-1.2.9 lib/zendesk2/client/requests/create_group.rb
zendesk2-1.2.7 lib/zendesk2/client/requests/create_group.rb
zendesk2-1.2.6 lib/zendesk2/client/requests/create_group.rb
zendesk2-1.2.5 lib/zendesk2/client/requests/create_group.rb
zendesk2-1.2.4 lib/zendesk2/client/requests/create_group.rb
zendesk2-1.2.3 lib/zendesk2/client/requests/create_group.rb
zendesk2-1.2.2 lib/zendesk2/client/requests/create_group.rb
zendesk2-1.2.1 lib/zendesk2/client/requests/create_group.rb
zendesk2-1.2.0 lib/zendesk2/client/requests/create_group.rb
zendesk2-1.1.3 lib/zendesk2/client/requests/create_group.rb
zendesk2-1.1.2 lib/zendesk2/client/requests/create_group.rb
zendesk2-1.0.0 lib/zendesk2/client/requests/create_group.rb