@@ -19,6 +19,11 @@ RSpec.describe "Well-known URLs", type: :request do
|
||||
context "user does not have a nostr pubkey configured" do
|
||||
let(:user) { create :user, cn: 'spongebob', ou: 'kosmos.org' }
|
||||
|
||||
before do
|
||||
allow_any_instance_of(User).to receive(:ldap_entry)
|
||||
.and_return({ nostr_key: nil })
|
||||
end
|
||||
|
||||
it "returns a 404 status" do
|
||||
get "/.well-known/nostr.json?name=spongebob"
|
||||
expect(response).to have_http_status(:not_found)
|
||||
@@ -26,8 +31,12 @@ RSpec.describe "Well-known URLs", type: :request do
|
||||
end
|
||||
|
||||
context "user with nostr pubkey" do
|
||||
let(:user) { create :user, cn: 'bobdylan', ou: 'kosmos.org', nostr_pubkey: '438d35a6750d0dd6b75d032af8a768aad76b62f0c70ecb45f9c4d9e63540f7f4' }
|
||||
before { user.save! }
|
||||
let(:user) { create :user, cn: 'bobdylan', ou: 'kosmos.org' }
|
||||
before do
|
||||
user.save!
|
||||
allow_any_instance_of(User).to receive(:nostr_pubkey)
|
||||
.and_return('438d35a6750d0dd6b75d032af8a768aad76b62f0c70ecb45f9c4d9e63540f7f4')
|
||||
end
|
||||
|
||||
it "returns a NIP-05 response" do
|
||||
get "/.well-known/nostr.json?name=bobdylan"
|
||||
|
||||
Reference in New Issue
Block a user