Tests for TokenIssuance#maybe_evict_clients
parent
5b8bee38e8
commit
0fd9859b02
|
@ -9,7 +9,7 @@ describe Transport::Mgmt do
|
|||
fake_connections = [{ "name" => "A", "user" => "1" },
|
||||
{ "name" => "B", "user" => "2" },
|
||||
{ "name" => "C", "user" => "3" }]
|
||||
allow(Transport::Mgmt).to receive(:connections).and_return(fake_connections)
|
||||
expect(Transport::Mgmt.find_connection_by_name("1")).to eq(["A"])
|
||||
allow(Transport::Mgmt).to receive(:connections).and_return(fake_connections)
|
||||
expect(Transport::Mgmt.find_connection_by_name("1")).to eq(["A"])
|
||||
end
|
||||
end
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
require "spec_helper"
|
||||
|
||||
describe TokenIssuance do
|
||||
it "notifies admins about failed message queue evictions" do
|
||||
allow(Transport::Mgmt)
|
||||
.to receive(:connections).and_raise(Faraday::ConnectionFailed, "rspec")
|
||||
allow(Rollbar).to receive(:error).and_return("OK")
|
||||
TokenIssuance.new(device_id: 8).maybe_evict_clients
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue