Sha256: 0d13ab9e8026453b03b9e6363ecea243903d87339b53ac5c9cb72c844a7df60b
Contents?: true
Size: 1.39 KB
Versions: 4
Compression:
Stored size: 1.39 KB
Contents
class YouTrack::Client::CreateIssue < YouTrack::Client::Request def real(params) service.request( :path => "/issue", :method => :put, :params => params, ) end def mock(_params) params = Cistern::Hash.stringify_keys(_params) issue = Cistern::Hash.slice(params, "project", "description", "summary") project = issue["projectShortName"] = issue.delete("project") index = service.data[:issues].size + 1 project_index = service.data[:issues].values.select { |i| i["projectShortName"] == project }.size identity = "#{project}-#{index}" issue.merge!( "id" => identity, "tag" => "", "numberInProject" => project_index, "created" => Time.now.to_i * 1000, "updated" => Time.now.to_i * 1000, "updaterName" => service.username, "updaterFullName" => service.username.capitalize, "reporterName" => service.username, "reporterFullName" => service.username.capitalize, "commentsCount" => "0", "votes" => "0", "custom_fields" => [ ["State", "Open"], ], # @fixme need these "attachments" => [], ) service.data[:issues][identity] = issue service.response( :response_headers => { "Location" => service.url_for("/issue/#{identity}"), }, :status => 201, ) end end
Version data entries
4 entries across 4 versions & 1 rubygems