2021-12-06 10:51:47 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2022-07-28 05:27:38 +03:00
|
|
|
RSpec.describe ApiKeyScope do
|
2023-01-09 11:18:21 +00:00
|
|
|
describe ".find_urls" do
|
|
|
|
it "should return the right urls" do
|
|
|
|
expect(ApiKeyScope.find_urls(actions: ["posts#create"], methods: [])).to contain_exactly(
|
|
|
|
"/posts (POST)",
|
|
|
|
)
|
2021-12-06 10:51:47 +08:00
|
|
|
end
|
2024-01-10 19:30:10 -07:00
|
|
|
|
|
|
|
it "should return logster urls" do
|
|
|
|
expect(ApiKeyScope.find_urls(actions: [Logster::Web], methods: [])).to contain_exactly(
|
|
|
|
"/logs/messages.json (POST)",
|
|
|
|
"/logs/show/:id.json (GET)",
|
|
|
|
)
|
|
|
|
end
|
2021-12-06 10:51:47 +08:00
|
|
|
end
|
|
|
|
end
|