Skip to content

Commit

Permalink
removing unused controller actions (#2812)
Browse files Browse the repository at this point in the history
* removing unused controller actions

* removing spec

* adding around each

---------

Co-authored-by: Sri Harsha <sriharsha.poosa@gmail.com>
  • Loading branch information
nisanthyaganti9 and sri49 authored Oct 29, 2024
1 parent 06fb282 commit 378dec9
Show file tree
Hide file tree
Showing 8 changed files with 3 additions and 69 deletions.
20 changes: 2 additions & 18 deletions app/controllers/employers/employer_profiles_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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))
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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")
Expand Down

This file was deleted.

This file was deleted.

7 changes: 0 additions & 7 deletions app/views/employers/employer_profiles/search.html.erb

This file was deleted.

1 change: 0 additions & 1 deletion app/views/employers/employer_profiles/search.js.erb

This file was deleted.

4 changes: 0 additions & 4 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
23 changes: 0 additions & 23 deletions spec/controllers/employers/employer_profiles_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down

0 comments on commit 378dec9

Please sign in to comment.