From 378dec9c2ee28ae819368a4a6726ced4a8c2be88 Mon Sep 17 00:00:00 2001 From: Nisanth Yaganti Date: Tue, 29 Oct 2024 13:38:09 -0400 Subject: [PATCH] removing unused controller actions (#2812) * removing unused controller actions * removing spec * adding around each --------- Co-authored-by: Sri Harsha --- .../employers/employer_profiles_controller.rb | 20 ++-------------- .../_remote_search_form.html.haml | 4 ---- .../bulk_employee_upload_form.html.erb | 11 --------- .../employer_profiles/search.html.erb | 7 ------ .../employers/employer_profiles/search.js.erb | 1 - config/routes.rb | 4 ---- .../employer_profiles_controller_spec.rb | 23 ------------------- ..._of_initial_employer_ineligibility_spec.rb | 2 +- 8 files changed, 3 insertions(+), 69 deletions(-) delete mode 100644 app/views/employers/employer_profiles/_remote_search_form.html.haml delete mode 100644 app/views/employers/employer_profiles/bulk_employee_upload_form.html.erb delete mode 100644 app/views/employers/employer_profiles/search.html.erb delete mode 100644 app/views/employers/employer_profiles/search.js.erb diff --git a/app/controllers/employers/employer_profiles_controller.rb b/app/controllers/employers/employer_profiles_controller.rb index a025fe9e961..123eedd844f 100644 --- a/app/controllers/employers/employer_profiles_controller.rb +++ b/app/controllers/employers/employer_profiles_controller.rb @@ -8,9 +8,9 @@ class EmployerProfilesController < ::ApplicationController before_action :redirect_new_model, only: [:show, :welcome, :index, :new, :show_profile, :edit, :generate_sic_tree, :create] before_action :find_employer, only: [:show, :show_profile, :destroy, :inbox, - :bulk_employee_upload, :bulk_employee_upload_form, :download_invoice, :export_census_employees, :link_from_quote, :new_document, :upload_document, :generate_checkbook_urls, :consumer_override] + :bulk_employee_upload, :download_invoice, :export_census_employees, :link_from_quote, :new_document, :upload_document, :generate_checkbook_urls, :consumer_override] - before_action :check_show_permissions, only: [:show, :show_profile, :destroy, :inbox, :bulk_employee_upload, :bulk_employee_upload_form] + before_action :check_show_permissions, only: [:show, :show_profile, :destroy, :inbox, :bulk_employee_upload] before_action :check_index_permissions, only: [:index] before_action :check_employer_staff_role, only: [:new] before_action :check_access_to_organization, only: [:edit] @@ -53,14 +53,6 @@ def index; end #Deprecated. Use new model version instead. def welcome; end - def search - @employer_profile = Forms::EmployerCandidate.new - respond_to do |format| - format.html - format.js - end - end - def match authorize @employer_profile @employer_candidate = Forms::EmployerCandidate.new(params.require(:employer_profile)) @@ -96,9 +88,6 @@ def match end end - #Deprecated. Use new model version instead. - def my_account; end - #Deprecated. Use new model version instead. def show; end @@ -172,8 +161,6 @@ def consumer_override redirect_to family_account_path end - def bulk_employee_upload_form; end - def generate_checkbook_urls authorize @employer_profile @employer_profile.generate_checkbook_notices @@ -257,9 +244,6 @@ def delete_documents end end - #Deprecated. Use new model version instead. - def counties_for_zip_code; end - # def employer_account_creation_notice # begin # ShopNoticesNotifierJob.perform_later(@organization.employer_profile.id.to_s, "employer_account_creation_notice") diff --git a/app/views/employers/employer_profiles/_remote_search_form.html.haml b/app/views/employers/employer_profiles/_remote_search_form.html.haml deleted file mode 100644 index 4f1ad7b97a9..00000000000 --- a/app/views/employers/employer_profiles/_remote_search_form.html.haml +++ /dev/null @@ -1,4 +0,0 @@ -.row - .col-md-9.col-sm-9.col-xs-12 - = render 'shared/error_messages', :object => @employer_profile - = render "employers/employer_profiles/employer_search_form" \ No newline at end of file diff --git a/app/views/employers/employer_profiles/bulk_employee_upload_form.html.erb b/app/views/employers/employer_profiles/bulk_employee_upload_form.html.erb deleted file mode 100644 index 4fc9a2353b5..00000000000 --- a/app/views/employers/employer_profiles/bulk_employee_upload_form.html.erb +++ /dev/null @@ -1,11 +0,0 @@ -THIS IS A DEMO FORM. WILL BE REPLACED BY A MODAL. -
-BULK UPLOAD/TERMINATE FOR CENCUS EMPLOYEES -
-
-
-
- - Upload A Valid CSV (Better error handling coming later)
- -
\ No newline at end of file diff --git a/app/views/employers/employer_profiles/search.html.erb b/app/views/employers/employer_profiles/search.html.erb deleted file mode 100644 index 985d6895f78..00000000000 --- a/app/views/employers/employer_profiles/search.html.erb +++ /dev/null @@ -1,7 +0,0 @@ -
-
-
- <%= render 'remote_search_form' %> -
-
-
\ No newline at end of file diff --git a/app/views/employers/employer_profiles/search.js.erb b/app/views/employers/employer_profiles/search.js.erb deleted file mode 100644 index f4742434920..00000000000 --- a/app/views/employers/employer_profiles/search.js.erb +++ /dev/null @@ -1 +0,0 @@ -$("#new_employer_wrapper").html("<%= escape_javascript(render "employers/employer_profiles/remote_search_form") %>"); \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 69dde473999..06f56b32098 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -310,11 +310,9 @@ resources :employer_profiles do get 'new' - get 'my_account' get 'show_profile' get 'link_from_quote' get 'consumer_override' - get 'bulk_employee_upload_form' post 'bulk_employee_upload' member do @@ -329,10 +327,8 @@ collection do get 'welcome' - get 'search' post 'match' get 'inbox' - get 'counties_for_zip_code' get 'generate_sic_tree' end resources :plan_years do diff --git a/spec/controllers/employers/employer_profiles_controller_spec.rb b/spec/controllers/employers/employer_profiles_controller_spec.rb index 4804cf3d03b..164fd3a6b17 100644 --- a/spec/controllers/employers/employer_profiles_controller_spec.rb +++ b/spec/controllers/employers/employer_profiles_controller_spec.rb @@ -93,29 +93,6 @@ end end - - describe "GET search", dbclean: :after_each do - before(:each) do - sign_in admin_user - get :search - end - - it "renders the 'search' template" do - expect(response).to have_http_status(:success) - expect(response).to render_template("search") - expect(assigns[:employer_profile]).to be_a(Forms::EmployerCandidate) - end - - context "without permissions" do - it "should return an error" do - sign_in(user) - get :delete_documents, params: {id: employer_profile.id, ids: [1]} - expect(flash[:error]).to match(/Access not allowed for employer_profile_policy/) - end - end - end - - describe "GET delete_documents", dbclean: :after_each do context "without permissions" do diff --git a/spec/notices/shop_employee_notices/notify_employee_of_initial_employer_ineligibility_spec.rb b/spec/notices/shop_employee_notices/notify_employee_of_initial_employer_ineligibility_spec.rb index 928b5828724..5f4b5ac97b2 100644 --- a/spec/notices/shop_employee_notices/notify_employee_of_initial_employer_ineligibility_spec.rb +++ b/spec/notices/shop_employee_notices/notify_employee_of_initial_employer_ineligibility_spec.rb @@ -4,7 +4,7 @@ require "#{BenefitSponsors::Engine.root}/spec/shared_contexts/benefit_market.rb" require "#{BenefitSponsors::Engine.root}/spec/shared_contexts/benefit_application.rb" -RSpec.describe ShopEmployeeNotices::NotifyEmployeeOfInitialEmployerIneligibility, :dbclean => :after_each do +RSpec.describe ShopEmployeeNotices::NotifyEmployeeOfInitialEmployerIneligibility, :dbclean => :around_each do include_context "setup benefit market with market catalogs and product packages" include_context "setup initial benefit application"