Skip to content

Commit

Permalink
refactor: Removes stubbed-out code for HM2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
cbaudouinjr committed Aug 18, 2020
1 parent 083c7f9 commit 44db700
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 51 deletions.
7 changes: 1 addition & 6 deletions app/controllers/manage/questionnaires_controller.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class Manage::QuestionnairesController < Manage::ApplicationController
include QuestionnairesControllable

before_action :set_questionnaire, only: [:show, :edit, :update, :destroy, :check_in, :convert_to_admin, :update_acc_status, :message_events]
before_action :set_questionnaire, only: [:show, :edit, :update, :destroy, :check_in, :convert_to_admin, :update_acc_status]

respond_to :html, :json

Expand Down Expand Up @@ -140,11 +140,6 @@ def bulk_apply
head :ok
end

def message_events
# TODO: stubbed for HM-2.1
# render json: @questionnaire.message_events
end

private

def questionnaire_params
Expand Down
6 changes: 0 additions & 6 deletions app/models/questionnaire.rb
Original file line number Diff line number Diff line change
Expand Up @@ -195,12 +195,6 @@ def did_rsvp?
['rsvp_confirmed', 'rsvp_denied'].include? acc_status
end

def message_events
return []
# TODO: stubbed for HM-2.1
# return [] unless ENV["SENDGRID_API_KEY"].presence
end

def verbal_status
if acc_status == "rsvp_denied"
"Not Attending"
Expand Down
13 changes: 0 additions & 13 deletions app/views/manage/questionnaires/_history.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,3 @@
.card-header Recent Changes
.card-body.pb-2
= render "model_history", model: @questionnaire, audits: @questionnaire.audits + @questionnaire.user.audits

-# Stubbed for HM-2.1
-# .col-lg-6
-# .card.mb-3
-# .card-header Recent Email Events
-# .card-body
-# - email_provider = Rails.application.config.action_mailer.delivery_method
-# - if email_provider == :sendgrid_actionmailer
-# .email-events{ data: { url: message_events_manage_questionnaire_path(@questionnaire) } }
-# %em Email events not available at this time.
-# - else
-# %p.alert.alert-info
-# Not supported with current email provider (#{email_provider})
1 change: 0 additions & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
patch :convert_to_admin, on: :member
patch :update_acc_status, on: :member
patch :bulk_apply, on: :collection
get :message_events, on: :member
end
resources :checkins do
post :datatable, on: :collection
Expand Down
1 change: 0 additions & 1 deletion docs/api-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ Example for questionnaire management endpoints:
convert_to_admin_manage_questionnaire PATCH /manage/questionnaires/:id/convert_to_admin(.:format) manage/questionnaires#convert_to_admin
update_acc_status_manage_questionnaire PATCH /manage/questionnaires/:id/update_acc_status(.:format) manage/questionnaires#update_acc_status
bulk_apply_manage_questionnaires PATCH /manage/questionnaires/bulk_apply(.:format) manage/questionnaires#bulk_apply
message_events_manage_questionnaire GET /manage/questionnaires/:id/message_events(.:format) manage/questionnaires#message_events
manage_questionnaires GET /manage/questionnaires(.:format) manage/questionnaires#index
POST /manage/questionnaires(.:format) manage/questionnaires#create
new_manage_questionnaire GET /manage/questionnaires/new(.:format) manage/questionnaires#new
Expand Down
24 changes: 0 additions & 24 deletions test/controllers/manage/questionnaires_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,6 @@ class Manage::QuestionnairesControllerTest < ActionController::TestCase
assert_redirected_to new_user_session_path
end

should "not allow access to manage_questionnaires#message_events" do
get :message_events, params: { id: @questionnaire }
assert_response :redirect
assert_redirected_to new_user_session_path
end

should "not allow access to manage_questionnaires#edit" do
get :edit, params: { id: @questionnaire }
assert_response :redirect
Expand Down Expand Up @@ -111,12 +105,6 @@ class Manage::QuestionnairesControllerTest < ActionController::TestCase
assert_redirected_to root_path
end

should "not allow access to manage_questionnaires#message_events" do
get :message_events, params: { id: @questionnaire }
assert_response :redirect
assert_redirected_to root_path
end

should "not allow access to manage_questionnaires#edit" do
get :edit, params: { id: @questionnaire }
assert_response :redirect
Expand Down Expand Up @@ -182,12 +170,6 @@ class Manage::QuestionnairesControllerTest < ActionController::TestCase
assert_response :success
end

#Stubbed for HM-2.1
#should "allow access to manage_questionnaires#message_events" do
#get :message_events, params: { id: @questionnaire }
#assert_response :success
#end

should "not allow access to manage_questionnaires#new" do
get :new, params: { id: @questionnaire }
assert_response :redirect
Expand Down Expand Up @@ -258,12 +240,6 @@ class Manage::QuestionnairesControllerTest < ActionController::TestCase
assert_response :success
end

# Stubbed for HM-2.1
# should "allow access to manage_questionnaires#message_events" do
# get :message_events, params: { id: @questionnaire }
# assert_response :success
# end

should "allow access to manage_questionnaires#edit" do
get :edit, params: { id: @questionnaire }
assert_response :success
Expand Down

0 comments on commit 44db700

Please sign in to comment.