Skip to content

Commit

Permalink
remove authenticate for InquiriesController#show action
Browse files Browse the repository at this point in the history
  • Loading branch information
Khoa-V-Nguyen committed Apr 24, 2024
1 parent dd5686d commit 648bb6b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class InquiriesController < ApplicationController
around_action :handle_exceptions
before_action :get_inquiries_by_icn, only: [:index]
before_action :get_inquiry_by_id, only: [:show]
skip_before_action :authenticate, only: %i[unauth_create upload_attachment test_create]
skip_before_action :authenticate, only: %i[unauth_create upload_attachment test_create show]
skip_before_action :verify_authenticity_token, only: %i[unauth_create upload_attachment test_create]

def index
Expand Down Expand Up @@ -63,6 +63,8 @@ def create_reply
private

def get_inquiry_by_id
entity_class = AskVAApi::Inquiries::Entity
retriever = Inquiries::Retriever.new(user_mock_data: params[:mock], entity_class:)
inq = retriever.fetch_by_id(id: params[:id])
@inquiry = Result.new(payload: Inquiries::Serializer.new(inq).serializable_hash, status: :ok)
end
Expand Down
8 changes: 0 additions & 8 deletions modules/ask_va_api/spec/requests/v0/inquiries_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -237,14 +237,6 @@
'Data Validation: No Inquiries found by ID A-20240423-30709'
end
end

context 'when user is not signed in' do
before do
get "#{inquiry_path}/#{valid_id}"
end

it { expect(response).to have_http_status(:unauthorized) }
end
end

describe 'GET #download_attachment' do
Expand Down

0 comments on commit 648bb6b

Please sign in to comment.