about summary refs log tree commit diff
path: root/spec/controllers
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2019-04-10 21:19:21 +0200
committerThibaut Girka <thib@sitedethib.com>2019-04-10 21:19:21 +0200
commit2f422b708f75bea87a49eb879ec3e0c3f35c2f9b (patch)
tree15a022b1b44f72fee2d83cfe6f8355b7334f9d9b /spec/controllers
parent92e19501949bac3825c23087e0aeba3109ea12d0 (diff)
parent5dd14dfdede5cfd98551f545336e18ad1c705c21 (diff)
Merge branch 'master' into glitch-soc/merge-upstream
Diffstat (limited to 'spec/controllers')
-rw-r--r--spec/controllers/settings/identity_proofs_controller_spec.rb17
1 files changed, 13 insertions, 4 deletions
diff --git a/spec/controllers/settings/identity_proofs_controller_spec.rb b/spec/controllers/settings/identity_proofs_controller_spec.rb
index 5c05eb83c..2a0f91088 100644
--- a/spec/controllers/settings/identity_proofs_controller_spec.rb
+++ b/spec/controllers/settings/identity_proofs_controller_spec.rb
@@ -28,11 +28,11 @@ describe Settings::IdentityProofsController do
 
   describe 'new proof creation' do
     context 'GET #new' do
-      context 'with all of the correct params' do
-        before do
-          allow_any_instance_of(ProofProvider::Keybase::Badge).to receive(:avatar_url) { full_pack_url('media/images/void.png') }
-        end
+      before do
+        allow_any_instance_of(ProofProvider::Keybase::Badge).to receive(:avatar_url) { full_pack_url('media/images/void.png') }
+      end
 
+      context 'with all of the correct params' do
         it 'renders the template' do
           get :new, params: new_proof_params
           expect(response).to render_template(:new)
@@ -54,6 +54,15 @@ describe Settings::IdentityProofsController do
           expect(flash[:alert]).to eq I18n.t('identity_proofs.errors.wrong_user', proving: 'someone_else', current: user.account.username)
         end
       end
+
+      context 'with params to prove the same username cased differently' do
+        let(:capitalized_username) { new_proof_params.merge(username: user.account.username.upcase) }
+
+        it 'renders the new template' do
+          get :new, params: capitalized_username
+          expect(response).to render_template(:new)
+        end
+      end
     end
 
     context 'POST #create' do