@@ -206,9 +206,21 @@ RSpec.describe User, type: :model do
|
||||
end
|
||||
end
|
||||
|
||||
describe "#nostr_pubkey" do
|
||||
before do
|
||||
allow_any_instance_of(User).to receive(:ldap_entry)
|
||||
.and_return({ nostr_key: "07e188a1ff87ce171d517b8ed2bb7a31b1d3453a0db3b15379ec07b724d232f3" })
|
||||
end
|
||||
|
||||
it "returns the raw pubkey from LDAP" do
|
||||
expect(user.nostr_pubkey).to eq("07e188a1ff87ce171d517b8ed2bb7a31b1d3453a0db3b15379ec07b724d232f3")
|
||||
end
|
||||
end
|
||||
|
||||
describe "#nostr_pubkey_bech32" do
|
||||
before do
|
||||
user.update! nostr_pubkey: "07e188a1ff87ce171d517b8ed2bb7a31b1d3453a0db3b15379ec07b724d232f3"
|
||||
allow_any_instance_of(User).to receive(:ldap_entry)
|
||||
.and_return({ nostr_key: "07e188a1ff87ce171d517b8ed2bb7a31b1d3453a0db3b15379ec07b724d232f3" })
|
||||
end
|
||||
|
||||
it "encodes the hexadecimal pubkey to bech32" do
|
||||
|
||||
Reference in New Issue
Block a user