WIP Add Webhooks controller, allowed IP config
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
20
spec/requests/webhooks_spec.rb
Normal file
20
spec/requests/webhooks_spec.rb
Normal file
@@ -0,0 +1,20 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe "Webhooks", type: :request do
|
||||
describe "Allowed IP addresses" do
|
||||
context "IP not allowed" do
|
||||
it "returns a 403 status" do
|
||||
post "/webhooks/lndhub"
|
||||
expect(response).to have_http_status(:forbidden)
|
||||
end
|
||||
end
|
||||
|
||||
context "IP allowed" do
|
||||
it "returns a 403 status" do
|
||||
ENV['WEBHOOKS_ALLOWED_IPS'] = '127.0.0.1'
|
||||
post "/webhooks/lndhub"
|
||||
expect(response).to have_http_status(:unprocessable_entity)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user