From 441afe7ab9825073e1e91f92ebcaa9413693517e Mon Sep 17 00:00:00 2001 From: Kevin Mulhern Date: Wed, 21 Jun 2023 19:50:02 +0100 Subject: [PATCH] Chore: Remove Unused Spec Support Files (#3869) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Because: * The best code is no code 💀 --- spec/support/api_helper.rb | 22 ---------------------- spec/support/shared_examples.rb | 12 ------------ 2 files changed, 34 deletions(-) delete mode 100644 spec/support/api_helper.rb delete mode 100644 spec/support/shared_examples.rb diff --git a/spec/support/api_helper.rb b/spec/support/api_helper.rb deleted file mode 100644 index 2208d705fa..0000000000 --- a/spec/support/api_helper.rb +++ /dev/null @@ -1,22 +0,0 @@ -module ApiHelper - include Rack::Test::Methods - - def app - Rails.application - end -end - -RSpec.configure do |config| - config.include ApiHelper, type: :api # apply to all spec for apis folder - - # rspec-rails 3 will no longer automatically infer an example group's spec type - # from the file location. You can explicitly opt-in to the feature using this - # config option. - # To explicitly tag specs without using automatic inference, set the `:type` - # metadata manually: - # - # describe ThingsController, :type => :controller do - # # Equivalent to being in spec/controllers - # end - config.infer_spec_type_from_file_location! -end diff --git a/spec/support/shared_examples.rb b/spec/support/shared_examples.rb deleted file mode 100644 index 4291cfd1a1..0000000000 --- a/spec/support/shared_examples.rb +++ /dev/null @@ -1,12 +0,0 @@ -RSpec.shared_examples 'unauthenticated request' do - it 'returns http unauthorized' do - expect(subject).to have_http_status(:unauthorized) - end -end - -RSpec.shared_examples 'unauthorized XHR request' do - it 'returns a http status of forbidden' do - request - expect(response).to have_http_status(:forbidden) - end -end