2021-12-05 21:51:47 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2022-07-27 22:27:38 -04:00
|
|
|
RSpec.describe ApiKeyScope do
|
2021-12-05 21:51:47 -05: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-10 21:30:10 -05: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-05 21:51:47 -05:00
|
|
|
end
|
|
|
|
end
|