From 9ce1fc0ce4bf224d0e2d4d34b9d40d0b8c02190e Mon Sep 17 00:00:00 2001 From: Karina Kwiatek Date: Sat, 1 Jan 2022 22:10:13 +0100 Subject: [PATCH] Address review comments from @nilsding Co-authored-by: Georg Gadinger --- app/controllers/services_controller.rb | 2 +- spec/controllers/services_controller_spec.rb | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/controllers/services_controller.rb b/app/controllers/services_controller.rb index 742013c3..5e6823a2 100644 --- a/app/controllers/services_controller.rb +++ b/app/controllers/services_controller.rb @@ -15,7 +15,7 @@ class ServicesController < ApplicationController flash[:success] = t('flash.service.create.success') else if service.errors.details.has_key?(:uid) && service.errors.details[:uid].any? { |err| err[:error] == :taken } - flash[:error] = "The #{service.type.split('::').last.titleize} account you are trying to connect is already connected to another #{APP_CONFIG['site_name']} account." + flash[:error] = "The #{service.type.split('::').last.titleize} account you are trying to connect is already connected to another #{APP_CONFIG['site_name']} account. If you are unable to disconnect the account yourself, please send us a Direct Message on Twitter: @retrospring." else flash[:error] = t('flash.service.create.error') end diff --git a/spec/controllers/services_controller_spec.rb b/spec/controllers/services_controller_spec.rb index 09113971..112e97e1 100644 --- a/spec/controllers/services_controller_spec.rb +++ b/spec/controllers/services_controller_spec.rb @@ -23,9 +23,9 @@ describe ServicesController, type: :controller do subject { get :create, params: { provider: 'twitter' } } context 'no services connected' do - it 'creates a service integration' do - expect { subject }.to change { Service.count }.by(1) - end + it 'creates a service integration' do + expect { subject }.to change { Service.count }.by(1) + end end context 'a user has a service connected' do @@ -34,7 +34,7 @@ describe ServicesController, type: :controller do it 'shows an error when trying to attach a service account which is already connected' do subject - expect(flash[:error]).to eq("The Twitter account you are trying to connect is already connected to another #{APP_CONFIG['site_name']} account.") + expect(flash[:error]).to eq("The Twitter account you are trying to connect is already connected to another #{APP_CONFIG['site_name']} account. If you are unable to disconnect the account yourself, please send us a Direct Message on Twitter: @retrospring.") end end end