Sha256: 0c5c156c9303e9d291ba15c19ceae9fda6a5d34422ed40a4216b999f28657920

Contents?: true

Size: 1.12 KB

Versions: 2

Compression:

Stored size: 1.12 KB

Contents

class RallyDefectResponder

  attr_reader :requests

  def initialize
    @requests = []
  end

  def last_request
    @requests.last
  end

  def call(env)
    @requests << request = Rack::Request.new(env)

    case request.url
    when "https://rally1.rallydev.com/slm/webservice/current/Defect?query=%28FormattedId+%3D+DE1234%29&fetch=true"
      [200, {}, [
        <<-XML
          <QueryResult>
            <Results>
              <Object>
                <FormattedID>DE1234</FormattedID>
                <Name>[Rework] Change link to button</Name>
                <PlanEstimate>1.0</PlanEstimate>
                <ScheduleState>In-Progress</ScheduleState>
                <TaskActualTotal>0.0</TaskActualTotal>
                <TaskEstimateTotal>6.5</TaskEstimateTotal>
                <TaskRemainingTotal>0.5</TaskRemainingTotal>
                <Owner>scootin@fruity.com</Owner>
                <Description>#{ CGI::escapeHTML('<div><p>This is a defect.</p></div>') }</Description>
              </Object>
            </Results>
            <TotalResultCount>1</TotalResultCount>
          </QueryResult>
XML
      ]]
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rallycat-0.3.0 spec/support/rally_defect_responder.rb
rallycat-0.2.0 spec/support/rally_defect_responder.rb