diff --git a/app/controllers/settings_controller.rb b/app/controllers/settings_controller.rb index b054740..841d0f2 100644 --- a/app/controllers/settings_controller.rb +++ b/app/controllers/settings_controller.rb @@ -12,7 +12,7 @@ class SettingsController < ApplicationController end def show - if @settings_section == "experiments" + if @settings_section == "nostr" session[:shared_secret] ||= SecureRandom.base64(12) end end @@ -120,7 +120,7 @@ class SettingsController < ApplicationController def remove_nostr_pubkey current_user.update! nostr_pubkey: nil - redirect_to setting_path(:experiments), flash: { + redirect_to setting_path(:nostr), flash: { success: 'Public key removed from account' } end @@ -134,8 +134,8 @@ class SettingsController < ApplicationController def set_settings_section @settings_section = params[:section] allowed_sections = [ - :profile, :account, :xmpp, :email, :lightning, :remotestorage, - :experiments + :profile, :account, :xmpp, :email, + :lightning, :remotestorage, :nostr ] unless allowed_sections.include?(@settings_section.to_sym) diff --git a/app/views/settings/_experiments.html.erb b/app/views/settings/_nostr.html.erb similarity index 100% rename from app/views/settings/_experiments.html.erb rename to app/views/settings/_nostr.html.erb diff --git a/app/views/shared/_sidenav_settings.html.erb b/app/views/shared/_sidenav_settings.html.erb index 86947b1..c8f17a5 100644 --- a/app/views/shared/_sidenav_settings.html.erb +++ b/app/views/shared/_sidenav_settings.html.erb @@ -34,7 +34,7 @@ <% end %> <% if Setting.nostr_enabled %> <%= render SidenavLinkComponent.new( - name: "Experiments", path: setting_path(:experiments), icon: "science", - active: @settings_section.to_s == "experiments" + name: "Nostr", path: setting_path(:nostr), icon: "nostrich-head", + active: @settings_section.to_s == "nostr" ) %> <% end %> diff --git a/spec/features/settings/experiments_spec.rb b/spec/features/settings/nostr_spec.rb similarity index 89% rename from spec/features/settings/experiments_spec.rb rename to spec/features/settings/nostr_spec.rb index dd43303..c2178fc 100644 --- a/spec/features/settings/experiments_spec.rb +++ b/spec/features/settings/nostr_spec.rb @@ -1,6 +1,6 @@ require 'rails_helper' -RSpec.describe 'Experimental Settings', type: :feature do +RSpec.describe 'Nostr Settings', type: :feature do let(:user) { create :user, cn: 'jimmy', ou: 'kosmos.org' } before do @@ -9,7 +9,7 @@ RSpec.describe 'Experimental Settings', type: :feature do describe 'Adding a nostr pubkey' do scenario 'Without nostr browser extension available' do - visit setting_path(:experiments) + visit setting_path(:nostr) expect(page).to have_content("No browser extension found") expect(page).to have_css('button[data-settings--nostr-pubkey-target=setPubkey]:disabled') end @@ -26,7 +26,7 @@ RSpec.describe 'Experimental Settings', type: :feature do end scenario 'Remove nostr pubkey from account' do - visit setting_path(:experiments) + visit setting_path(:nostr) expect(page).to have_field("nostr_public_key", with: "npub1qlsc3g0lsl8pw8230w8d9wm6xxcax3f6pkemz5measrmwfxjxteslf2hac", disabled: true) diff --git a/spec/requests/settings_spec.rb b/spec/requests/settings_spec.rb index 8bd04ab..5d2ba17 100644 --- a/spec/requests/settings_spec.rb +++ b/spec/requests/settings_spec.rb @@ -7,9 +7,9 @@ RSpec.describe "Settings", type: :request do login_as user, :scope => :user end - describe "GET /settings/experiments" do + describe "GET /settings/nostr" do it "works" do - get setting_path(:experiments) + get setting_path(:nostr) expect(response).to have_http_status(200) end end