Skip to content
This repository
Fetching contributors…

Cannot retrieve contributors at this time

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

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

  def test_push
    @stubs.post "/publicapi/add" do |env|
      assert_equal 'api.prowlapp.com', env[:url].host
      data = Rack::Utils.parse_query(env[:body])
      assert_equal 'a', data['apikey']
      [200, {}, '']
    end

    svc = service({'apikey' => 'a'}, payload)
    svc.receive_push
  end

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