Merge pull request 'Fix XMPP from-address config not being used' (#150) from bugfix/xmpp_from_address into master
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #150
This commit is contained in:
commit
be5fe00f20
@ -30,7 +30,7 @@ class WebhooksController < ApplicationController
|
|||||||
def notify_xmpp(address, amt_sats, memo)
|
def notify_xmpp(address, amt_sats, memo)
|
||||||
payload = {
|
payload = {
|
||||||
type: "normal",
|
type: "normal",
|
||||||
from: Setting.primary_domain,
|
from: Setting.xmpp_notifications_from_address,
|
||||||
to: address,
|
to: address,
|
||||||
subject: "Sats received!",
|
subject: "Sats received!",
|
||||||
body: "#{helpers.number_with_delimiter amt_sats} sats received in your Lightning wallet:\n> #{memo}"
|
body: "#{helpers.number_with_delimiter amt_sats} sats received in your Lightning wallet:\n> #{memo}"
|
||||||
|
@ -68,6 +68,7 @@ RSpec.describe "Webhooks", type: :request do
|
|||||||
|
|
||||||
context "notification preference set to 'xmpp'" do
|
context "notification preference set to 'xmpp'" do
|
||||||
before do
|
before do
|
||||||
|
Setting.xmpp_notifications_from_address = "botka@kosmos.org"
|
||||||
user.update! preferences: { lightning_notify_sats_received: "xmpp" }
|
user.update! preferences: { lightning_notify_sats_received: "xmpp" }
|
||||||
post "/webhooks/lndhub", params: payload.to_json
|
post "/webhooks/lndhub", params: payload.to_json
|
||||||
end
|
end
|
||||||
@ -78,7 +79,7 @@ RSpec.describe "Webhooks", type: :request do
|
|||||||
|
|
||||||
msg = enqueued_jobs.first["arguments"].first
|
msg = enqueued_jobs.first["arguments"].first
|
||||||
expect(msg["type"]).to eq("normal")
|
expect(msg["type"]).to eq("normal")
|
||||||
expect(msg["from"]).to eq("kosmos.org")
|
expect(msg["from"]).to eq("botka@kosmos.org")
|
||||||
expect(msg["to"]).to eq(user.address)
|
expect(msg["to"]).to eq(user.address)
|
||||||
expect(msg["subject"]).to eq("Sats received!")
|
expect(msg["subject"]).to eq("Sats received!")
|
||||||
expect(msg["body"]).to match(/^12,300 sats received/)
|
expect(msg["body"]).to match(/^12,300 sats received/)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user