diff --git a/app/controllers/auth/registrations_controller.rb b/app/controllers/auth/registrations_controller.rb index 71eb0905e94297b5dc7790654e00b29c1db417ed..7b7f6b52dfc99c5369fd61ceb4c423a6096d0696 100644 --- a/app/controllers/auth/registrations_controller.rb +++ b/app/controllers/auth/registrations_controller.rb @@ -17,6 +17,6 @@ class Auth::RegistrationsController < Devise::RegistrationsController end def after_sign_up_path_for(_resource) - root_path + new_user_session_path end end diff --git a/app/lib/formatter.rb b/app/lib/formatter.rb index 17d2dfc58526adaba9b54894ec55c810d5709c75..60bc3733eba6765cfded0cda7946e0428c80f0bb 100644 --- a/app/lib/formatter.rb +++ b/app/lib/formatter.rb @@ -29,7 +29,9 @@ class Formatter end def link_urls(html) - auto_link(html, link: :urls, html: { rel: 'nofollow noopener' }) + auto_link(html, link: :urls, html: { rel: 'nofollow noopener' }) do |text| + truncate(text.gsub(/\Ahttps?:\/\/(www\.)?/, ''), length: 30) + end end def link_mentions(html, mentions) diff --git a/spec/lib/formatter_spec.rb b/spec/lib/formatter_spec.rb index 36c4af7481562291d414f1cb770e520332fdf82d..927211938a1e3278c96817f676e9a302b35d251c 100644 --- a/spec/lib/formatter_spec.rb +++ b/spec/lib/formatter_spec.rb @@ -17,7 +17,7 @@ RSpec.describe Formatter do end it 'contains a link' do - expect(subject).to match('<a rel="nofollow noopener" href="http://google.com">http://google.com</a>') + expect(subject).to match('<a rel="nofollow noopener" href="http://google.com">google.com</a>') end end