Sha256: dea863c1b093af23ef7469c988ed68d3181a2b1c902d37e3a8aafb82cb0f1b83

Contents?: true

Size: 769 Bytes

Versions: 2

Compression:

Stored size: 769 Bytes

Contents

require "spec_helper"

describe Uniqush::RestfulClient do
  let(:base_url) { "http://yourinstall.com" }
  let(:client) { described_class.new(base_url) }
  let(:a_hash) { {foo: "bar", baz: "bam"} }

  describe "services" do
    it "adds service" do
      expect { client.add_service(a_hash) }.
        to request(:post, "#{base_url}/push_service_providers").with(body: a_hash.to_json)
    end
  end

  describe "subscriptions" do
    it "subscribes" do
      expect { client.subscribe_device(a_hash) }.
        to request(:post, "#{base_url}/subscribers").with(body: a_hash.to_json)
    end
  end

  describe "pushing" do
    it "pushes" do
      expect { client.push(a_hash) }.
        to request(:post, "#{base_url}/push").with(body: a_hash.to_json)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
uniqush-rb-0.0.5 spec/uniqush/restul_client_spec.rb
uniqush-rb-0.0.2 spec/uniqush/restul_client_spec.rb