Sha256: b6ff6b409dd7d6149669ec3d77679dc860fd07295c273c66ce33291f14c65329

Contents?: true

Size: 726 Bytes

Versions: 54

Compression:

Stored size: 726 Bytes

Contents

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

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

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

      path = "/topics.json"
      self.data[:topics][identity]= record

      response(
        :method => :post,
        :body   => {"topic" => record},
        :path   => path,
      )
    end
  end # Mock
end

Version data entries

54 entries across 54 versions & 1 rubygems

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