Sha256: 617a82ce46d3b90cae10872631200367fa86e0e72724b4a320f714f208fe90af

Contents?: true

Size: 565 Bytes

Versions: 1

Compression:

Stored size: 565 Bytes

Contents

require "./lib/notifilter"
require "byebug"

describe Notifilter do
  around do |spec|
    @server = UDPSocket.new
    @server.bind("127.0.0.1", "8001")
    ENV["NOTIFILTER_PORT"] = "8001"
    spec.run
    @server.close
  end

  it "sends correct message" do
    data = { "id" => 1, "name" => "John Doe", "active" => false }
    Notifilter.notify("test_app", "user.created", data)

    received = @server.recv(1000)
    result = { "application" => "test_app", "identifier" => "user.created", "data" => data }
    expect(JSON.parse(received)).to eq result
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
notifilter-0.0.1 spec/notifilter_spec.rb