Let user remove nostr pubkey from account

This commit is contained in:
Râu Cao
2023-03-08 16:43:59 +07:00
parent 49de4007ab
commit e8bbe6c713
5 changed files with 64 additions and 5 deletions

View File

@@ -19,4 +19,22 @@ RSpec.describe 'Experimental Settings', type: :feature do
# worth it for now
# end
end
context "With pubkey configured" do
before do
user.update! nostr_pubkey: "07e188a1ff87ce171d517b8ed2bb7a31b1d3453a0db3b15379ec07b724d232f3"
end
scenario 'Remove nostr pubkey from account' do
visit settings_experiments_path
expect(page).to have_field("nostr_public_key",
with: "07e188a1ff87ce171d517b8ed2bb7a31b1d3453a0db3b15379ec07b724d232f3",
disabled: true)
click_link "Remove"
expect(page).to_not have_field("nostr_public_key")
expect(page).to have_content("verify your public key")
expect(user.reload.nostr_pubkey).to be_nil
end
end
end