Skip to content
This repository is currently being migrated. It's locked while the migration is in progress.
Comment thread
jeremyhunton-va marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

require 'rails_helper'

class FakeController < ApplicationController
class FakeHeaderModController < ApplicationController
include AppealsApi::HeaderModification
end

describe FakeController do
describe FakeHeaderModController do
context "adding a 'Deprecation' header to the response" do
context "when a 'Response' object is not provided" do
it "An 'ArgumentError' is raised" do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

require 'rails_helper'

class FakeController < ApplicationController
class FakeEndpointDeprecationController < ApplicationController
include ClaimsApi::EndpointDeprecation
end

describe FakeController do
describe FakeEndpointDeprecationController do
context "adding a 'Deprecation' header to the response" do
context "when a 'Response' object is not provided" do
it "An 'ArgumentError' is raised" do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

require 'rails_helper'

class FakeController < ApplicationController
class FakePOAVerificationController < ApplicationController
include ClaimsApi::PoaVerification

def initialize
Expand All @@ -22,7 +22,7 @@ def target_veteran
end
end

describe FakeController do
describe FakePOAVerificationController do
context 'validating poa_code for current_user' do
let(:poa_code) { '091' }
let(:first_name) { 'John' }
Expand Down Expand Up @@ -125,14 +125,16 @@ def target_veteran

describe '#verify_power_of_attorney!' do
before do
allow_any_instance_of(FakeController).to receive(:token).and_return(double(client_credentials_token?: false))
allow_any_instance_of(FakePOAVerificationController).to receive(
:token
).and_return(double(client_credentials_token?: false))
veteran_user = double('Veteran::User')
allow(Veteran::User).to receive(:new).and_return(veteran_user)
allow(veteran_user).to receive(:power_of_attorney).and_return(double(try: 'some_code'))
end

it 'handles an Unauthorized error' do
allow_any_instance_of(FakeController).to receive(:valid_poa_code_for_current_user?).and_raise(Common::Exceptions::Unauthorized)
allow_any_instance_of(FakePOAVerificationController).to receive(:valid_poa_code_for_current_user?).and_raise(Common::Exceptions::Unauthorized)

expect do
subject.verify_power_of_attorney!
Expand All @@ -157,7 +159,9 @@ def target_veteran
let(:mock_exception) { Breakers::OutageException.new(mock_outage, mock_service) }

it 'handles an Breakers Outage error' do
Comment thread
jeremyhunton-va marked this conversation as resolved.
allow_any_instance_of(FakeController).to receive(:valid_poa_code_for_current_user?).and_raise(mock_exception)
allow_any_instance_of(FakePOAVerificationController).to receive(
:valid_poa_code_for_current_user?
).and_raise(mock_exception)

expect do
subject.verify_power_of_attorney!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
require 'bd/bd'
require 'bgs_service/person_web_service'

class FakeController
class FakeDocumentsController
include ClaimsApi::V2::ClaimsRequests::SupportingDocuments

def local_bgs_service
Expand Down Expand Up @@ -67,7 +67,7 @@ def params

let(:dummy_class) { Class.new { include ClaimsApi::V2::ClaimsRequests::SupportingDocuments } }

Comment thread
jeremyhunton-va marked this conversation as resolved.
Outdated
let(:controller) { FakeController.new }
let(:controller) { FakeDocumentsController.new }

before do
allow(Flipper).to receive(:enabled?).with(:lighthouse_claims_api_use_birls_id).and_return(false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

require 'rails_helper'

class FakeController
class FakeTrackedItemsAssistanceController
include ClaimsApi::V2::ClaimsRequests::TrackedItemsAssistance
end

describe FakeController do
describe FakeTrackedItemsAssistanceController do
context 'when the claims controller calls the TrackedItemsAssistance module' do
let(:claim_date) { Date.parse('2024-08-22 07:36:25 -0600') }
let(:status) { 'Complete' }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
require 'rails_helper'
require 'bgs_service/tracked_item_service'

class FakeController
class FakeTrackedItemsController
include ClaimsApi::V2::ClaimsRequests::TrackedItems
include ClaimsApi::V2::ClaimsRequests::TrackedItemsAssistance
Comment thread
jeremyhunton-va marked this conversation as resolved.
Outdated

Expand Down Expand Up @@ -31,7 +31,7 @@ def target_veteran
end
end

describe FakeController do
describe FakeTrackedItemsController do
context 'when the claims controller calls the tracked_items module' do
let(:claim_id) { '600118544' }
let(:bgs_claim) do
Expand Down
Loading