Sha256: 81a097de4047dab131a204fdb4b1bf56c0472631e7d1c657c983a1fa4be2c682

Contents?: true

Size: 645 Bytes

Versions: 23

Compression:

Stored size: 645 Bytes

Contents

require 'httparty'

require_relative 'base_adapter'

module Gitlab
  module Triage
    module NetworkAdapters
      class TestAdapter < BaseAdapter
        def get(_token, url)
          results =
            case url
            when %r{\Ahttps://gitlab.com/v4/issues?per_page=100}
              [
                { id: 1, title: 'First issue' }
              ]
            else
              []
            end

          {
            more_pages: false,
            next_page_url: nil,
            results: results
          }
        end

        def post(token, url, body)
          # no-op in tests
        end
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
gitlab-triage-1.1.1 lib/gitlab/triage/network_adapters/test_adapter.rb
gitlab-triage-1.1.0 lib/gitlab/triage/network_adapters/test_adapter.rb
gitlab-triage-1.0.1 lib/gitlab/triage/network_adapters/test_adapter.rb
gitlab-triage-1.0.0 lib/gitlab/triage/network_adapters/test_adapter.rb
gitlab-triage-0.17.0 lib/gitlab/triage/network_adapters/test_adapter.rb
gitlab-triage-0.16.0 lib/gitlab/triage/network_adapters/test_adapter.rb
gitlab-triage-0.15.0 lib/gitlab/triage/network_adapters/test_adapter.rb
gitlab-triage-0.14.1 lib/gitlab/triage/network_adapters/test_adapter.rb
gitlab-triage-0.14.0 lib/gitlab/triage/network_adapters/test_adapter.rb
gitlab-triage-0.13.0 lib/gitlab/triage/network_adapters/test_adapter.rb
gitlab-triage-0.12.0 lib/gitlab/triage/network_adapters/test_adapter.rb
gitlab-triage-0.11.0 lib/gitlab/triage/network_adapters/test_adapter.rb
gitlab-triage-0.10.0 lib/gitlab/triage/network_adapters/test_adapter.rb
gitlab-triage-0.9.0 lib/gitlab/triage/network_adapters/test_adapter.rb
gitlab-triage-0.8.1 lib/gitlab/triage/network_adapters/test_adapter.rb
gitlab-triage-0.8.0 lib/gitlab/triage/network_adapters/test_adapter.rb
gitlab-triage-0.7.0 lib/gitlab/triage/network_adapters/test_adapter.rb
gitlab-triage-0.6.0 lib/gitlab/triage/network_adapters/test_adapter.rb
gitlab-triage-0.5.0 lib/gitlab/triage/network_adapters/test_adapter.rb
gitlab-triage-0.4.0 lib/gitlab/triage/network_adapters/test_adapter.rb