Fix exception for NIP-05 JSON of "_" with relay configured
This commit is contained in:
@@ -75,6 +75,19 @@ RSpec.describe "Well-known URLs", type: :request do
|
||||
expect(res["names"]["_"]).to eq(Setting.nostr_public_key)
|
||||
end
|
||||
|
||||
context "with relay configured" do
|
||||
before do
|
||||
Setting.nostr_relay_url = "wss://nostr.kosmos.org"
|
||||
end
|
||||
|
||||
it "returns the pubkey and relay" do
|
||||
get "/.well-known/nostr.json?name=_"
|
||||
res = JSON.parse(response.body)
|
||||
expect(res["relays"]["_"].length).to eq(1)
|
||||
expect(res["relays"]["_"].first).to eq("wss://nostr.kosmos.org")
|
||||
end
|
||||
end
|
||||
|
||||
context "nostr service integration not enabled" do
|
||||
before do
|
||||
Setting.nostr_enabled = false
|
||||
|
||||
Reference in New Issue
Block a user