Skip to content
This repository
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 26 lines (20 sloc) 0.557 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 'cgi'

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

  def test_push
    @stubs.get "/api/version" do |env|
      assert_equal 'www.example.com', env[:url].host
      [200, {}, '{"data":{"major":12,"minor":0,"build":2}}']
    end

    @stubs.post "/api/github" do |env|
      [200, {}, '']
    end

    svc = service({'ontime_url' => 'http://www.example.com/', 'api_key' => 'test_api_key'}, payload)
    svc.receive_push
  end

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