2021-12-06 10:51:47 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2022-07-28 10:27:38 +08:00
|
|
|
RSpec.describe ApiKeyScope do
|
2021-12-06 10:51:47 +08: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)",
|
|
|
|
)
|
|
|
|
end
|
2024-01-11 10:30:10 +08: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
|