-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[wip] Specs for TravelPay::ClaimsController
- Loading branch information
Athif Wulandana
committed
Mar 5, 2024
1 parent
0c3140d
commit 9d70123
Showing
2 changed files
with
29 additions
and
5 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
modules/travel_pay/spec/controllers/claims_controller_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'rails_helper' | ||
|
||
RSpec.describe TravelPay::ClaimsController, type: :controller do | ||
before do | ||
veis_response = double | ||
allow(veis_response).to receive(:body).and_return( {'access_token' => 'sample_token'} ) | ||
allow_any_instance_of(TravelPay::Client).to receive(:request_veis_token).and_return(veis_response) | ||
btsss_ping_response = double | ||
allow(btsss_ping_response).to receive(:status).and_return('online') | ||
allow_any_instance_of(TravelPay::Client).to receive(:ping).and_return(btsss_ping_response) | ||
end | ||
|
||
describe '#index' do | ||
it 'requests a token and sends a ping to BTSSS' do | ||
get(:index) | ||
expect(response.body).to eq('Received ping from upstream server with status online.') | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters