Add more specs for new logic

pull/897/head
Rick Carlino 2018-06-25 15:11:19 -05:00
parent 6799202f00
commit 048517db3e
1 changed files with 9 additions and 0 deletions

View File

@ -15,6 +15,15 @@ describe Api::RmqUtilsController do
password: token }
end
it "allows admins to do anything" do
Api::RmqUtilsController::ALL.map do |action|
post action, params: { username: "admin",
password: ENV.fetch("ADMIN_PASSWORD") }
expect(response.status).to eq(200)
expect(response.body).to include("allow")
end
end
it "allows access to ones own topic" do
p = credentials.merge(routing_key: "bot.#{credentials[:username]}.logs")
post :topic, params: p