Refactor user preferences, add defaults from file
* Turn prefs into a flat hash structure, since nesting is not worth the trouble * Add a custom serializer class for prefs * Add a config file for defaults and merge set prefs with unset ones * Use booleans for "true" and "false", and integers where appropriate
This commit is contained in:
@@ -68,7 +68,7 @@ RSpec.describe "Webhooks", type: :request do
|
||||
|
||||
context "notification preference set to 'xmpp'" do
|
||||
before do
|
||||
user.update! preferences: { "lightning" => { "notify_sats_received" => "xmpp" }}
|
||||
user.update! preferences: { lightning_notify_sats_received: "xmpp" }
|
||||
post "/webhooks/lndhub", params: payload.to_json
|
||||
end
|
||||
|
||||
@@ -87,7 +87,7 @@ RSpec.describe "Webhooks", type: :request do
|
||||
|
||||
context "notification preference set to 'email'" do
|
||||
before do
|
||||
user.update! preferences: { "lightning" => { "notify_sats_received" => "email" }}
|
||||
user.update! preferences: { lightning_notify_sats_received: "email" }
|
||||
post "/webhooks/lndhub", params: payload.to_json
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user