Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

file 25 lines (21 sloc) 0.631 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
require File.expand_path('../helper', __FILE__)

class RedmineTest < Service::TestCase
  def setup
    @stubs = Faraday::Adapter::Test::Stubs.new
  end

  def test_push
    @stubs.get "/a/sys/fetch_changesets" do |env|
      assert_equal 'r.com', env[:url].host
      data = Rack::Utils.parse_nested_query(env[:body])
      assert_equal 'a', env[:params]['key']
      assert_equal 'p', env[:params]['id']
      [200, {}, '']
    end

    svc = service({'address' => 'http://r.com/a/',
      'api_key' => 'a', 'project' => 'p'}, :a => 1)
    svc.receive_push
  end

  def service(*args)
    super Service::Redmine, *args
  end
end
Something went wrong with that request. Please try again.