Sha256: d22f90d2e91f31c91a434c10ac1e31a5e84defc9aca6090c92dbc7f5449514fa
Contents?: true
Size: 1.01 KB
Versions: 13
Compression:
Stored size: 1.01 KB
Contents
require "spec_helper" describe Pubnub::Signal do it_behaves_like "an event" context "given basic parameters" do before :each do @pubnub = Pubnub::Client.new( subscribe_key: "demo", publish_key: "demo", auth_key: "ruby-test-auth", uuid: "ruby-test-uuid", ) end it "works" do VCR.use_cassette("lib/events/signal", record: :once) do envelope = @pubnub.signal( channel: :demo, message: "whatever", ).value expect(envelope.status).to satisfies_schema Pubnub::Schemas::Envelope::StatusSchema.new end end it "forms valid ErrorEnvelope on error" do VCR.use_cassette("lib/events/signal-error", record: :once) do envelope = @pubnub.signal( channel: :demo, message: "0" * 50 ).value expect(envelope.is_a?(Pubnub::ErrorEnvelope)).to eq true expect(envelope.status).to satisfies_schema Pubnub::Schemas::Envelope::StatusSchema.new end end end end
Version data entries
13 entries across 13 versions & 1 rubygems