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-0.2.1 lib/zendesk2/client/requests/create_topic.rb
zendesk2-0.2.0 lib/zendesk2/client/requests/create_topic.rb
zendesk2-0.1.3 lib/zendesk2/client/requests/create_topic.rb
zendesk2-0.1.2 lib/zendesk2/client/requests/create_topic.rb
zendesk2-0.1.1 lib/zendesk2/client/requests/create_topic.rb
zendesk2-0.1.0 lib/zendesk2/client/requests/create_topic.rb
zendesk2-0.0.23 lib/zendesk2/client/requests/create_topic.rb
zendesk2-0.0.22 lib/zendesk2/client/requests/create_topic.rb
zendesk2-0.0.20 lib/zendesk2/client/requests/create_topic.rb
zendesk2-0.0.19 lib/zendesk2/client/requests/create_topic.rb
zendesk2-0.0.18 lib/zendesk2/client/requests/create_topic.rb
zendesk2-0.0.17 lib/zendesk2/client/requests/create_topic.rb
zendesk2-0.0.16 lib/zendesk2/client/requests/create_topic.rb
zendesk2-0.0.15 lib/zendesk2/client/requests/create_topic.rb