diff --git a/spec/controllers/repositories_controller_spec.rb b/spec/controllers/repositories_controller_spec.rb index d4e022d..c8f5375 100644 --- a/spec/controllers/repositories_controller_spec.rb +++ b/spec/controllers/repositories_controller_spec.rb @@ -556,5 +556,15 @@ describe RepositoriesController, :type => :controller do it { is_expected.to respond_with(:not_found) } end + + context 'with an invalid request' do + before :each do + Repository.expects(:find).with(repository.id).returns(repository) + Webhooks::GitLab.any_instance.expects(:valid_request?).returns(false) + post_push + end + + it { is_expected.to respond_with(:unprocessable_entity) } + end end end -- libgit2 0.21.2