index int64 0 0 | repo_id stringclasses 829
values | file_path stringlengths 34 254 | content stringlengths 6 5.38M |
|---|---|---|---|
0 | code_files/vets-api-private/spec/lib | code_files/vets-api-private/spec/lib/kafka/form_trace_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'kafka/models/form_trace'
RSpec.describe Kafka::FormTrace do
let(:valid_attributes) do
{
prior_id: nil,
current_id: '123',
next_id: nil,
icn: nil,
vasi_id: 'vasi-456',
system_name: 'Lighthouse',
submission_nam... |
0 | code_files/vets-api-private/spec/lib | code_files/vets-api-private/spec/lib/kafka/avro_producer_payload_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'kafka/avro_producer'
require 'kafka/oauth_token_refresher'
describe Kafka::AvroProducer do
let(:avro_producer) { described_class.new }
let(:valid_payload) do
{
'priorId' => nil,
'currentId' => '12345',
'nextId' => nil,
'icn'... |
0 | code_files/vets-api-private/spec/lib | code_files/vets-api-private/spec/lib/kafka/avro_producer_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'kafka/avro_producer'
require 'kafka/oauth_token_refresher'
require 'kafka/schema_registry/service'
describe Kafka::AvroProducer do
let(:avro_producer) { described_class.new }
let(:topic) { 'submission_trace_form_status_change' }
let(:valid_payload) d... |
0 | code_files/vets-api-private/spec/lib | code_files/vets-api-private/spec/lib/kafka/event_bus_submission_job_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'kafka/sidekiq/event_bus_submission_job'
require 'kafka/avro_producer'
RSpec.describe Kafka::EventBusSubmissionJob, type: :job do
let(:topic) { 'submission_trace_form_status_change' }
let(:payload) { { 'data' => { 'ICN' => 'id' } } }
let(:monitor) { i... |
0 | code_files/vets-api-private/spec/lib | code_files/vets-api-private/spec/lib/kafka/enhanced_listener_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'kafka/enhanced_listener'
RSpec.describe Kafka::EnhancedListener do
let(:mock_statsd_client) { instance_double(Datadog::Statsd) }
let(:listener) do
described_class.new do |config|
config.client = mock_statsd_client
config.default_tags = ... |
0 | code_files/vets-api-private/spec/lib/kafka | code_files/vets-api-private/spec/lib/kafka/schema_registry/service_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'kafka/schema_registry/service'
describe Kafka::SchemaRegistry::Service do
let(:service) { described_class.new }
let(:topic_name) { 'submission_trace_form_status_change' }
let(:version) { '1' }
let(:topic_1_response) do
{
'subject' => 'sub... |
0 | code_files/vets-api-private/spec/lib/kafka | code_files/vets-api-private/spec/lib/kafka/concerns/kafka_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'kafka/concerns/kafka'
RSpec.describe Kafka do
describe '#get_topic' do
context 'when use_test_topic is false' do
it 'returns the production topic name' do
expect(Kafka.get_topic(use_test_topic: false)).to eq('submission_trace_form_statu... |
0 | code_files/vets-api-private/spec/lib | code_files/vets-api-private/spec/lib/decision_review/configuration_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'caseflow/configuration'
describe DecisionReview::Configuration do
describe '.read_timeout' do
context 'when Settings.caseflow.timeout is set' do
it 'uses the setting' do
expect(DecisionReview::Configuration.instance.read_timeout).to eq(... |
0 | code_files/vets-api-private/spec/lib | code_files/vets-api-private/spec/lib/decision_review/schemas_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'decision_review/schemas'
shared_examples 'test schema' do
it('JSON is valid') { expect(schema).to be_a Hash }
it('JSON Schema is valid') { expect(validator).to be_truthy }
it('fixture has no errors') { expect(errors).to be_empty }
end
describe Decis... |
0 | code_files/vets-api-private/spec/lib/decision_review/utilities | code_files/vets-api-private/spec/lib/decision_review/utilities/saved_claim/service_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'decision_review/utilities/saved_claim/service'
class Service < ApplicationController
include DecisionReview::SavedClaim::Service
end
describe Service do
describe '.store_saved_claim' do
let(:guid) { SecureRandom.uuid }
let(:claim_class) { Save... |
0 | code_files/vets-api-private/spec/lib | code_files/vets-api-private/spec/lib/claim_documents/monitor_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'claim_documents/monitor'
RSpec.describe ClaimDocuments::Monitor do
let(:service) { OpenStruct.new(uuid: 'uuid') }
let(:monitor) { described_class.new }
let(:document_stats_key) { described_class::DOCUMENT_STATS_KEY }
let(:form_id) { 'ABC123' }
le... |
0 | code_files/vets-api-private/spec/lib | code_files/vets-api-private/spec/lib/okta/directory_service_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'okta/directory_service'
require 'vcr'
RSpec.describe Okta::DirectoryService do
let(:subject) { described_class.new }
describe '#scopes' do
it 'directs to #handle_health_server as expected' do
allow_any_instance_of(Okta::DirectoryService).to ... |
0 | code_files/vets-api-private/spec/lib | code_files/vets-api-private/spec/lib/dangerfile/parameter_filtering_allowlist_checker_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'dangerfile/parameter_filtering_allowlist_checker'
RSpec.describe Dangerfile::ParameterFilteringAllowlistChecker do
subject(:checker) { described_class.new }
describe '#allowlist_changed?' do
context 'when a parameter is added to ALLOWLIST' do
... |
0 | code_files/vets-api-private/spec/lib | code_files/vets-api-private/spec/lib/search_click_tracking/configuration_spec.rb | # frozen_string_literal: true
require 'rails_helper'
describe SearchClickTracking::Configuration do
describe '#service_name' do
it 'has the expected service name' do
expect(described_class.instance.service_name).to eq('SearchClickTracking')
end
end
end
|
0 | code_files/vets-api-private/spec/lib | code_files/vets-api-private/spec/lib/search_click_tracking/service_spec.rb | # frozen_string_literal: true
require 'rails_helper'
# require 'search_click_tracking/service'
# Rerecording VCR Cassettes
# 1. Replace TEST_KEY (`before` block) with Settings.search_click_tracking.access_key from Staging
# 2. Delete exsiting cassette file
# 3. Re-run spec
# 4. **IMPORTANT** Replace the Access Key wi... |
0 | code_files/vets-api-private/spec/lib | code_files/vets-api-private/spec/lib/pcpg/monitor_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require_relative '../../../lib/pcpg/monitor'
RSpec.describe PCPG::Monitor do
let(:monitor) { described_class.new }
let(:claim_stats_key) { described_class::CLAIM_STATS_KEY }
let(:submission_stats_key) { described_class::SUBMISSION_STATS_KEY }
let(:benefits_... |
0 | code_files/vets-api-private/spec/lib/bid | code_files/vets-api-private/spec/lib/bid/awards/service_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'bid/awards/service'
RSpec.describe BID::Awards::Service do
let(:user) { create(:evss_user, :loa3) }
let(:service) { BID::Awards::Service.new(user) }
describe '#get_awards_pension' do
let(:faraday_response) { double('faraday_connection') }
b... |
0 | code_files/vets-api-private/spec/lib | code_files/vets-api-private/spec/lib/gibft/service_spec.rb | # frozen_string_literal: true
require 'rails_helper'
describe Gibft::Service, type: :model do
let(:service) { described_class.new }
let(:client) { double }
describe '#submit' do
before do
expect(service).to receive(:get_oauth_token).and_return('token')
expect(Restforce).to receive(:new).with(
... |
0 | code_files/vets-api-private/spec/lib/lighthouse | code_files/vets-api-private/spec/lib/lighthouse/benefits_intake/metadata_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'lighthouse/benefits_intake/metadata'
RSpec.describe BenefitsIntake::Metadata do
let(:meta) { described_class }
context 'with valid parameters' do
let(:valid) do
{
'veteranFirstName' => 'firstname',
'veteranLastName' => 'lastn... |
0 | code_files/vets-api-private/spec/lib/lighthouse | code_files/vets-api-private/spec/lib/lighthouse/benefits_intake/configuration_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'common/client/configuration/rest'
require 'lighthouse/benefits_intake/configuration'
RSpec.describe BenefitsIntake::Configuration do
let(:base) { Common::Client::Configuration::REST }
let(:config) { BenefitsIntake::Configuration.send(:new) }
let(:set... |
0 | code_files/vets-api-private/spec/lib/lighthouse | code_files/vets-api-private/spec/lib/lighthouse/benefits_intake/service_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'common/file_helpers'
require 'lighthouse/benefits_intake/service'
require 'pdf_utilities/pdf_validator'
RSpec.describe BenefitsIntake::Service do
let(:service) { BenefitsIntake::Service.new }
let(:metadata) do
{
'veteranFirstName' => 'firstna... |
0 | code_files/vets-api-private/spec/lib/lighthouse/benefits_intake | code_files/vets-api-private/spec/lib/lighthouse/benefits_intake/submission_handler/saved_claim_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'lighthouse/benefits_intake/submission_handler/saved_claim'
Rspec.describe BenefitsIntake::SubmissionHandler::SavedClaim do
let(:handler) { BenefitsIntake::SubmissionHandler::SavedClaim }
let(:claim) { double(form_id: 'TEST', id: 23) }
let(:monitor) {... |
0 | code_files/vets-api-private/spec/lib/lighthouse/benefits_intake | code_files/vets-api-private/spec/lib/lighthouse/benefits_intake/sidekiq/submission_status_job_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'lighthouse/benefits_intake/sidekiq/submission_status_job'
Rspec.describe BenefitsIntake::SubmissionStatusJob, type: :job do
let(:job) { described_class.new }
let(:stats_key) { described_class::STATS_KEY }
context 'flipper is disabled' do
before ... |
0 | code_files/vets-api-private/spec/lib/lighthouse | code_files/vets-api-private/spec/lib/lighthouse/healthcare_cost_and_coverage/configuration_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'lighthouse/healthcare_cost_and_coverage/configuration'
RSpec.describe Lighthouse::HealthcareCostAndCoverage::Configuration do
subject(:config) { described_class.instance }
let(:settings) do
double(
host: 'https://test-api.va.gov',
time... |
0 | code_files/vets-api-private/spec/lib/lighthouse/healthcare_cost_and_coverage | code_files/vets-api-private/spec/lib/lighthouse/healthcare_cost_and_coverage/payment_reconciliation/service_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'lighthouse/healthcare_cost_and_coverage/payment_reconciliation/service'
RSpec.describe Lighthouse::HealthcareCostAndCoverage::PaymentReconciliation::Service do
let(:icn) { '1234567890V123456' }
let(:service) { described_class.new(icn) }
let(:response... |
0 | code_files/vets-api-private/spec/lib/lighthouse/healthcare_cost_and_coverage | code_files/vets-api-private/spec/lib/lighthouse/healthcare_cost_and_coverage/encounter/service_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'lighthouse/healthcare_cost_and_coverage/encounter/service'
RSpec.describe Lighthouse::HealthcareCostAndCoverage::Encounter::Service do
let(:icn) { '1234567890V123456' }
let(:service) { described_class.new(icn) }
let(:response_body) { { 'resourceType'... |
0 | code_files/vets-api-private/spec/lib/lighthouse/healthcare_cost_and_coverage | code_files/vets-api-private/spec/lib/lighthouse/healthcare_cost_and_coverage/medication_dispense/service_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'lighthouse/healthcare_cost_and_coverage/medication_dispense/service'
RSpec.describe Lighthouse::HealthcareCostAndCoverage::MedicationDispense::Service do
subject(:svc) { described_class.new(icn) }
let(:icn) { '43000199' }
let(:config) { instance_... |
0 | code_files/vets-api-private/spec/lib/lighthouse/healthcare_cost_and_coverage | code_files/vets-api-private/spec/lib/lighthouse/healthcare_cost_and_coverage/medication/service_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'lighthouse/healthcare_cost_and_coverage/medication/service'
RSpec.describe Lighthouse::HealthcareCostAndCoverage::Medication::Service do
let(:icn) { '43000199' }
let(:service) { described_class.new(icn) }
let(:medication_id) { '4-1abOXvmAJfxtQJ' }
... |
0 | code_files/vets-api-private/spec/lib/lighthouse/healthcare_cost_and_coverage | code_files/vets-api-private/spec/lib/lighthouse/healthcare_cost_and_coverage/account/service_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'lighthouse/healthcare_cost_and_coverage/account/service'
RSpec.describe Lighthouse::HealthcareCostAndCoverage::Account::Service do
let(:icn) { '43000199' }
let(:service) { described_class.new(icn) }
let(:response_body) { { 'resourceType' => 'Bundle',... |
0 | code_files/vets-api-private/spec/lib/lighthouse/healthcare_cost_and_coverage | code_files/vets-api-private/spec/lib/lighthouse/healthcare_cost_and_coverage/charge_item/service_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'lighthouse/healthcare_cost_and_coverage/charge_item/service'
RSpec.describe Lighthouse::HealthcareCostAndCoverage::ChargeItem::Service do
let(:icn) { '1234567890V123456' }
let(:service) { described_class.new(icn) }
let(:response_body) { { 'resourceTy... |
0 | code_files/vets-api-private/spec/lib/lighthouse/healthcare_cost_and_coverage | code_files/vets-api-private/spec/lib/lighthouse/healthcare_cost_and_coverage/invoice/service_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'lighthouse/healthcare_cost_and_coverage/invoice/service'
RSpec.describe Lighthouse::HealthcareCostAndCoverage::Invoice::Service do
let(:icn) { '1234567890V123456' }
let(:service) { described_class.new(icn) }
let(:response_body) { { 'resourceType' => ... |
0 | code_files/vets-api-private/spec/lib/lighthouse/auth | code_files/vets-api-private/spec/lib/lighthouse/auth/client_credentials/jwt_generator_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'lighthouse/auth/client_credentials/jwt_generator'
RSpec.describe Auth::ClientCredentials::JWTGenerator do
let(:public_key) { OpenSSL::PKey::RSA.new(File.read('spec/support/certificates/lhdd-fake-public.pem')) }
it 'generates a valid JWT token' do
... |
0 | code_files/vets-api-private/spec/lib/lighthouse/auth | code_files/vets-api-private/spec/lib/lighthouse/auth/client_credentials/service_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'lighthouse/auth/client_credentials/service'
RSpec.describe Auth::ClientCredentials::Service do
let(:url) { 'https://sandbox-api.va.gov/oauth2/api/system/v1/token' }
let(:client_id) { '1234567890' }
let(:api_scopes) { %w[api.read api.write] }
let(:a... |
0 | code_files/vets-api-private/spec/lib/lighthouse/auth | code_files/vets-api-private/spec/lib/lighthouse/auth/client_credentials/access_token_tracker_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'lighthouse/auth/client_credentials/access_token_tracker'
RSpec.describe Auth::ClientCredentials::AccessTokenTracker, type: :model do
describe '#get_access_token' do
context 'with blank service_name' do
it 'returns nil' do
expect(describ... |
0 | code_files/vets-api-private/spec/lib/lighthouse | code_files/vets-api-private/spec/lib/lighthouse/veterans_health/client_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'lighthouse/veterans_health/client'
RSpec.describe Lighthouse::VeteransHealth::Client do
# setting the client only once for this test set, as it mimics how it's
# used in the Sidekiq worker disability_compensation_fast_track_job.rb
before do
@cli... |
0 | code_files/vets-api-private/spec/lib/lighthouse/veterans_health | code_files/vets-api-private/spec/lib/lighthouse/veterans_health/integration/client_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'lighthouse/veterans_health/client'
RSpec.describe Lighthouse::VeteransHealth::Client, :vcr do
describe '#list_medication_requests' do
context 'with a multi-page response' do
subject(:client) { described_class.new(32_000_225).list_medication_req... |
0 | code_files/vets-api-private/spec/lib/lighthouse/veterans_health | code_files/vets-api-private/spec/lib/lighthouse/veterans_health/serializers/immunization_serializer_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'lighthouse/veterans_health/serializers/immunization_serializer'
RSpec.describe Lighthouse::VeteransHealth::Serializers::ImmunizationSerializer do
describe '.extract_group_name' do
before do
allow(Flipper).to receive(:enabled?).with(:mhv_vaccine... |
0 | code_files/vets-api-private/spec/lib/lighthouse | code_files/vets-api-private/spec/lib/lighthouse/letters_generator/service_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'lighthouse/letters_generator/service'
require 'lighthouse/letters_generator/service_error'
FAKE_RESPONSES_PATH = 'spec/lib/lighthouse/letters_generator/fakeResponses'
RSpec.describe Lighthouse::LettersGenerator::Service do
before do
@stubs = Faraday... |
0 | code_files/vets-api-private/spec/lib/lighthouse/letters_generator | code_files/vets-api-private/spec/lib/lighthouse/letters_generator/fakeResponses/fakeBadRequest.json | {
"type": "https://api.va.gov/services/letters/v1/api-schema/errors/constraint-violation",
"title": "Invalid field value",
"status": 400,
"detail": "getLettersResponse.icn must match \"^\\d{10}V\\d{6}$\", getLettersResponse.icn size must be between 17 and 17",
"instance": "e6d1119e-dc91-4b4d-b583-0f309de0807b... |
0 | code_files/vets-api-private/spec/lib/lighthouse/letters_generator | code_files/vets-api-private/spec/lib/lighthouse/letters_generator/fakeResponses/fakeUnauthorized.json | {
"message": "Invalid authentication credentials"
}
|
0 | code_files/vets-api-private/spec/lib/lighthouse/letters_generator | code_files/vets-api-private/spec/lib/lighthouse/letters_generator/fakeResponses/fakeProofOfServiceLetterResponse.json | {
"letterDescription": "This card verifies that you served honorably in the Armed Forces.",
"letterContent": [
{
"contentKey": "front-of-card",
"contentTitle": "<front of card>",
"content": "This card is to serve as proof the individual listed below served honorably in the Uniformed Services o... |
0 | code_files/vets-api-private/spec/lib/lighthouse/letters_generator | code_files/vets-api-private/spec/lib/lighthouse/letters_generator/fakeResponses/fakeResponse.json | {
"messages": [
{
"key": "letterGeneration.letterEligibilityError",
"text": "string",
"severity": "WARN"
}
],
"letters": [
{
"letterName": "Benefit Summary Dependent",
"letterType": "BENEFIT_SUMMARY_DEPENDENT"
}
],
"letterDestination": {
"country": "USA",
... |
0 | code_files/vets-api-private/spec/lib/lighthouse/letters_generator | code_files/vets-api-private/spec/lib/lighthouse/letters_generator/fakeResponses/fakeResponse_no_award.json | {
"messages": [
{
"key": "letterGeneration.letterEligibilityError",
"text": "string",
"severity": "WARN"
}
],
"letters": [
{
"letterName": "Benefit Summary Dependent",
"letterType": "BENEFIT_SUMMARY_DEPENDENT"
}
],
"letterDestination": {
"country": "USA",
... |
0 | code_files/vets-api-private/spec/lib/lighthouse/letters_generator | code_files/vets-api-private/spec/lib/lighthouse/letters_generator/fakeResponses/fakeTimeout.json | {
"type": "https://api.va.gov/services/letters/v1/api-schema/errors/constraint-violation",
"title": "Gateway Timeout",
"status": 504,
"detail": "Timed out",
"instance": "e6d1119e-dc91-4b4d-b583-0f309de0807b"
}
|
0 | code_files/vets-api-private/spec/lib/lighthouse | code_files/vets-api-private/spec/lib/lighthouse/benefits_claims/service_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'lighthouse/benefits_claims/service'
require 'evss/disability_compensation_form/form_submit_response'
RSpec.describe BenefitsClaims::Service do
let(:service) { BenefitsClaims::Service.new('123498767V234859') }
describe 'making requests' do
context ... |
0 | code_files/vets-api-private/spec/lib/lighthouse/benefits_claims | code_files/vets-api-private/spec/lib/lighthouse/benefits_claims/intent_to_file/monitor_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'lighthouse/benefits_claims/intent_to_file/monitor'
RSpec.describe BenefitsClaims::IntentToFile::Monitor do
let(:monitor) { described_class.new }
let(:itf_stats_key) { described_class::STATSD_KEY_PREFIX }
let(:itf_v1_stats_key) { described_class::STAT... |
0 | code_files/vets-api-private/spec/lib/lighthouse | code_files/vets-api-private/spec/lib/lighthouse/benefits_discovery/params_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'lighthouse/benefits_discovery/params'
RSpec.describe BenefitsDiscovery::Params do
subject { described_class.new(user) }
let(:user) { create(:user, :loa3, :accountable, :legacy_icn) }
let(:prepared_service_history_params) do
[{
startDate: '... |
0 | code_files/vets-api-private/spec/lib/lighthouse | code_files/vets-api-private/spec/lib/lighthouse/benefits_discovery/service_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'lighthouse/benefits_discovery/service'
RSpec.describe BenefitsDiscovery::Service do
subject do
described_class.new(
api_key: 'test_api_key',
app_id: 'test_app_id'
)
end
describe '#get_eligible_benefits' do
context 'with param... |
0 | code_files/vets-api-private/spec/lib/lighthouse | code_files/vets-api-private/spec/lib/lighthouse/benefits_education/service_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'lighthouse/benefits_education/service'
RSpec.describe BenefitsEducation::Service do
let(:icn) { '1012667145V762142' }
let(:service) { BenefitsEducation::Service.new(icn) }
# Veteran's ICN is now considered PII - do not include it
# in the output o... |
0 | code_files/vets-api-private/spec/lib/lighthouse | code_files/vets-api-private/spec/lib/lighthouse/veteran_verification/service_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'lighthouse/veteran_verification/constants'
require 'lighthouse/veteran_verification/service'
require 'lighthouse/service_exception'
RSpec.describe VeteranVerification::Service do
let(:service) { VeteranVerification::Service.new }
describe 'making requ... |
0 | code_files/vets-api-private/spec/lib/lighthouse | code_files/vets-api-private/spec/lib/lighthouse/direct_deposit/payment_account_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'lighthouse/direct_deposit/payment_account'
RSpec.describe Lighthouse::DirectDeposit::PaymentAccount do
let(:account) do
described_class.new(
account_type: 'CHECKING',
routing_number: '123456789',
account_number: 'ABC456789'
)
... |
0 | code_files/vets-api-private/spec/lib/lighthouse | code_files/vets-api-private/spec/lib/lighthouse/benefits_documents/configuration_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'lighthouse/benefits_documents/configuration'
RSpec.describe BenefitsDocuments::Configuration do
before do
# Required to prevent inconsistent failure on CI pipeline
Flipper.enable('va_online_scheduling')
token = 'abcd1234'
allow_any_insta... |
0 | code_files/vets-api-private/spec/lib/lighthouse | code_files/vets-api-private/spec/lib/lighthouse/benefits_documents/upload_status_updater_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'lighthouse/benefits_documents/upload_status_updater'
require 'lighthouse/benefits_documents/constants'
require 'lighthouse/benefits_documents/utilities/helpers'
RSpec.describe BenefitsDocuments::UploadStatusUpdater do
let(:lighthouse_document_upload) do
... |
0 | code_files/vets-api-private/spec/lib/lighthouse | code_files/vets-api-private/spec/lib/lighthouse/benefits_documents/service_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'lighthouse/benefits_documents/service'
require 'lighthouse_document'
require 'lighthouse/benefits_documents/configuration'
RSpec.describe BenefitsDocuments::Service do
subject { service }
let(:user) { create(:user, :loa3) }
let(:user_account) { crea... |
0 | code_files/vets-api-private/spec/lib/lighthouse | code_files/vets-api-private/spec/lib/lighthouse/benefits_documents/update_documents_status_service_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'lighthouse/benefits_documents/update_documents_status_service'
require 'lighthouse/benefits_documents/documents_status_polling_service'
RSpec.describe BenefitsDocuments::UpdateDocumentsStatusService do
describe '#call' do
let(:lighthouse_document_upl... |
0 | code_files/vets-api-private/spec/lib/lighthouse/benefits_documents | code_files/vets-api-private/spec/lib/lighthouse/benefits_documents/form526/polled_document_failure_handler_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'lighthouse/benefits_documents/form526/polled_document_failure_handler'
RSpec.describe BenefitsDocuments::Form526::PolledDocumentFailureHandler do
subject { described_class }
describe '#call' do
context 'when the polled document was a piece of Vete... |
0 | code_files/vets-api-private/spec/lib/lighthouse/benefits_documents | code_files/vets-api-private/spec/lib/lighthouse/benefits_documents/form526/upload_status_updater_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'lighthouse/benefits_documents/form526/upload_status_updater'
RSpec.describe BenefitsDocuments::Form526::UploadStatusUpdater do
let(:lighthouse526_document_upload) { create(:lighthouse526_document_upload) }
let(:past_date_time) { DateTime.new(1985, 10, ... |
0 | code_files/vets-api-private/spec/lib/lighthouse/benefits_documents | code_files/vets-api-private/spec/lib/lighthouse/benefits_documents/form526/update_documents_status_service_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'lighthouse/benefits_documents/form526/update_documents_status_service'
require 'lighthouse/benefits_documents/form526/documents_status_polling_service'
RSpec.describe BenefitsDocuments::Form526::UpdateDocumentsStatusService do
let(:start_time) { Time.new... |
0 | code_files/vets-api-private/spec/lib/lighthouse/benefits_documents | code_files/vets-api-private/spec/lib/lighthouse/benefits_documents/form526/upload_supplemental_document_service_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'lighthouse/benefits_documents/form526/upload_supplemental_document_service'
require 'lighthouse/service_exception'
RSpec.describe BenefitsDocuments::Form526::UploadSupplementalDocumentService do
subject { described_class }
let(:file_body) { File.read(... |
0 | code_files/vets-api-private/spec/lib/lighthouse | code_files/vets-api-private/spec/lib/lighthouse/facilities/client_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'lighthouse/facilities/client'
vcr_options = {
cassette_name: '/lighthouse/facilities',
match_requests_on: %i[path query],
allow_playback_repeats: true
}
RSpec.describe Lighthouse::Facilities::Client, team: :facilities, vcr: vcr_options do
let(:fac... |
0 | code_files/vets-api-private/spec/lib/lighthouse/facilities | code_files/vets-api-private/spec/lib/lighthouse/facilities/v1/client_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'lighthouse/facilities/v1/client'
RSpec.describe Lighthouse::Facilities::V1::Client do
let(:client) { described_class.new }
let(:params) { { bbox: [60.99, 10.54, 180.00, 20.55] } }
let(:data) do
[
{ 'id' => 'vha_042',
'attributes' =>... |
0 | code_files/vets-api-private/spec/lib/lighthouse/facilities | code_files/vets-api-private/spec/lib/lighthouse/facilities/v1/response_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'lighthouse/facilities/v1/response'
RSpec.describe Lighthouse::Facilities::V1::Response, type: :model do
subject { described_class.new(response_body, response_status) }
let(:data) do
[
{ 'id' => 'vha_042', 'attributes' => { 'name' => 'Facilit... |
0 | code_files/vets-api-private/spec/lib | code_files/vets-api-private/spec/lib/slack/service_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'slack/service'
describe Slack::Service do
let(:slack_hash) { { channel: '#vsp_test_channel', webhook: 'https://hooks.slack.com/services/asdf1234' } }
let(:subject) { described_class.new(slack_hash) }
let(:header) { 'Slack Notification Header String E... |
0 | code_files/vets-api-private/spec/lib | code_files/vets-api-private/spec/lib/lgy/service_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'lgy/service'
require 'saved_claim/coe_claim'
describe LGY::Service do
subject { described_class.new(edipi: user.edipi, icn: user.icn) }
let(:user) { create(:evss_user, :loa3, :legacy_icn) }
let(:coe_claim) { create(:coe_claim) }
describe '#get_de... |
0 | code_files/vets-api-private/spec/lib | code_files/vets-api-private/spec/lib/generators/module_helper_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'rails/generators'
require_relative '../../../lib/generators/module_helper'
describe ModuleHelper do
class DummyGenerator < Rails::Generators::NamedBase
include ModuleHelper
end
context 'file insert' do
it 'tests module_generator_file_insert ... |
0 | code_files/vets-api-private/spec/lib/generators | code_files/vets-api-private/spec/lib/generators/module_component/module_components_generator_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'generators/module_component/module_component_generator'
require 'generators/module/module_generator'
RSpec.describe 'ModuleComponent', type: :generator do
before(:all) do
@original_stdout = $stdout
# Redirect stdout to suppress generator output
... |
0 | code_files/vets-api-private/spec/lib/generators | code_files/vets-api-private/spec/lib/generators/module/module_generator_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'generators/module/module_generator'
describe ModuleGenerator do
let(:module_name) { 'foo' }
after do
# remove generated files
FileUtils.rm_rf(Rails.root.glob("modules/#{module_name}"))
end
describe 'create_directory_structure' do
let(... |
0 | code_files/vets-api-private/spec/lib | code_files/vets-api-private/spec/lib/breakers/statsd_plugin_spec.rb | # frozen_string_literal: true
require 'rails_helper'
describe Breakers::StatsdPlugin do
let(:request) { Faraday::Env.new }
let(:response) { Faraday::Env.new }
let(:test_host) { 'https://test-host.gov' }
describe 'get_tags' do
context 'request is sent' do
it 'adds method tag when available' do
... |
0 | code_files/vets-api-private/spec/lib/vye | code_files/vets-api-private/spec/lib/vye/dgib/configuration_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'vye/dgib/configuration'
require 'vye/dgib/authentication_token_service'
describe Vye::DGIB::Configuration do
describe '#base_path' do
it 'has a base path' do
expect(Vye::DGIB::Configuration.instance.base_path).to eq(Settings.dgi.vye.vets.url.to... |
0 | code_files/vets-api-private/spec/lib/vye | code_files/vets-api-private/spec/lib/vye/dgib/authentication_token_service_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'vye/dgib/authentication_token_service'
RSpec.describe Vye::DGIB::AuthenticationTokenService do
describe '.call' do
let(:token) { described_class.call }
it 'returns an authentication token' do
decoded_token =
JWT.decode(
t... |
0 | code_files/vets-api-private/spec/lib/vye | code_files/vets-api-private/spec/lib/vye/dgib/service_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'vye/dgib/service'
require 'vye/dgib/response'
RSpec.describe Vye::DGIB::Service do
include ActiveSupport::Testing::TimeHelpers
let(:user) { create(:user, :loa3) }
let(:service) { described_class.new(user) }
describe '#claimant_lookup' do
let(:... |
0 | code_files/vets-api-private/spec/lib/vye | code_files/vets-api-private/spec/lib/vye/dgib/response_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'vye/dgib/response'
RSpec.describe Vye::DGIB::Response do
# Helper method to transform fixture data from camelCase to snake_case
# This mimics the transformation that happens in production via Faraday's :snakecase middleware
# which converts API respo... |
0 | code_files/vets-api-private/spec/lib | code_files/vets-api-private/spec/lib/search_gsa/configuration_spec.rb | # frozen_string_literal: true
require 'rails_helper'
describe SearchGsa::Configuration do
describe '#service_name' do
it 'has the expected service name' do
expect(described_class.instance.service_name).to eq('SearchGsa/Results')
end
end
describe '#base_path' do
it 'provides api.gsa.gov search... |
0 | code_files/vets-api-private/spec/lib | code_files/vets-api-private/spec/lib/search_gsa/service_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'lib/search/shared_examples_for_pagination'
describe SearchGsa::Service do
subject { described_class.new(query) }
let(:query) { 'benefits' }
before do
allow_any_instance_of(described_class).to receive(:access_key).and_return('TESTKEY')
end
... |
0 | code_files/vets-api-private/spec/lib | code_files/vets-api-private/spec/lib/search_gsa/shared_examples_for_pagination.rb | # frozen_string_literal: true
require 'rails_helper'
shared_examples 'pagination data' do
context 'when requesting page 1 of results' do
subject { described_class.new(query, 1) }
it 'returns the correct pagination information' do
VCR.use_cassette('search/page_1') do
pagination = subject.resul... |
0 | code_files/vets-api-private/spec/lib | code_files/vets-api-private/spec/lib/efolder/service_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require Rails.root.join('modules', 'claims_api', 'spec', 'support', 'fake_vbms.rb')
require 'efolder/service'
RSpec.describe Efolder::Service do
subject { described_class.new(user) }
let(:file_number) { '796043735' }
let(:user) { build(:user, :loa3, ssn: fil... |
0 | code_files/vets-api-private/spec/lib | code_files/vets-api-private/spec/lib/sentry/event_scrubber_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'sentry/event_scrubber'
RSpec.describe Sentry::EventScrubber do
let(:unclean_event) { { email: 'test@example.com', zipCode: '12345' } }
let(:cleaned_event) { Sentry::EventScrubber.new(unclean_event, nil).cleaned_event }
let(:warning_data) do
{
... |
0 | code_files/vets-api-private/spec/lib/sentry | code_files/vets-api-private/spec/lib/sentry/scrubbers/pii_sanitizer_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'support/saml/response_builder'
require 'sentry/scrubbers/pii_sanitizer'
RSpec.describe Sentry::Scrubbers::PIISanitizer do
include SAML::ResponseBuilder
let(:scrubber) { Sentry::Scrubbers::PIISanitizer.new }
let(:result) { scrubber.process(data) }
... |
0 | code_files/vets-api-private/spec/lib/sentry | code_files/vets-api-private/spec/lib/sentry/scrubbers/email_sanitizer_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'sentry/scrubbers/email_sanitizer'
RSpec.describe Sentry::Scrubbers::EmailSanitizer do
let(:bad_string) { 'Email is: joe.schmoe@gmail.com, bad!' }
let(:good_string) { 'Email is: [FILTERED EMAIL], bad!' }
before do
@scrubber = Sentry::Scrubbers::E... |
0 | code_files/vets-api-private/spec/lib/sentry | code_files/vets-api-private/spec/lib/sentry/scrubbers/log_as_warning_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'sentry/scrubbers/log_as_warning'
RSpec.describe Sentry::Scrubbers::LogAsWarning do
let(:scrubber) { Sentry::Scrubbers::LogAsWarning.new }
let(:result) { scrubber.process(data) }
let(:data) do
{
event_id: '26eb47ec7a74430f89348c9dda4bda2b',... |
0 | code_files/vets-api-private/spec/lib/sentry | code_files/vets-api-private/spec/lib/sentry/scrubbers/filter_request_body_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'sentry/scrubbers/filter_request_body'
RSpec.describe Sentry::Scrubbers::FilterRequestBody do
context 'with PII in the [:request][:data] hash' do
before do
@scrubber = Sentry::Scrubbers::FilterRequestBody.new
end
it 'filters PII for a c... |
0 | code_files/vets-api-private/spec/lib/claim_letters | code_files/vets-api-private/spec/lib/claim_letters/providers/claim_letters_provider_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'claim_letters/providers/claim_letters/claim_letters_provider'
RSpec.describe ClaimLettersProvider do
# Create a test class that includes the module
let(:test_class) do
Class.new do
include ClaimLettersProvider
end
end
let(:provider) {... |
0 | code_files/vets-api-private/spec/lib/claim_letters | code_files/vets-api-private/spec/lib/claim_letters/providers/lighthouse_claim_letters_provider_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'claim_letters/providers/claim_letters/lighthouse_claim_letters_provider'
require 'claim_letters/responses/claim_letters_response'
require 'claim_letters/utils/letter_transformer'
require 'support/claim_letters/claims_letters_provider'
RSpec.describe Lighth... |
0 | code_files/vets-api-private/spec/lib/claim_letters | code_files/vets-api-private/spec/lib/claim_letters/utils/letter_transformer_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'claim_letters/utils/letter_transformer'
RSpec.describe ClaimLetters::Utils::LetterTransformer do
describe '.allowed?' do
let(:allowed_doctypes) { %w[27 123 456] }
context 'when doc has :doc_type key' do
it 'returns true when doc_type is in... |
0 | code_files/vets-api-private/spec/lib/claim_letters | code_files/vets-api-private/spec/lib/claim_letters/utils/user_helper_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'claim_letters/utils/user_helper'
RSpec.describe ClaimLetters::Utils::UserHelper do
# Shared user class for testing Object-type users
let(:user_class) do
Class.new do
attr_accessor :file_number, :ssn, :participant_id
def initialize(file... |
0 | code_files/vets-api-private/spec/lib | code_files/vets-api-private/spec/lib/apps/client_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'apps/client'
describe Apps::Client do
subject { described_class.new(search_term) }
let(:search_term) { nil }
describe '#get_all' do
context 'with no query' do
it 'returns an apps response object' do
VCR.use_cassette('apps/200_all_... |
0 | code_files/vets-api-private/spec/lib | code_files/vets-api-private/spec/lib/apps/configuration_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'apps/configuration'
describe Apps::Configuration do
describe '#service_name' do
it 'has the expected service name' do
expect(described_class.instance.service_name).to eq('APPS')
end
end
describe '#base_path' do
it 'returns the base... |
0 | code_files/vets-api-private/spec/lib/faraday_adapter_socks/faraday | code_files/vets-api-private/spec/lib/faraday_adapter_socks/faraday/adapter/net_http_socks_spec.rb | # frozen_string_literal: true
# Reference: https://github.com/goldeneggg/faraday_adapter_socks/blob/master/spec/faraday/adapter/net_http_socks_spec.rb
require 'rails_helper'
describe Faraday::Adapter::NetHttpSocks do
describe 'setup' do
it 'has 3 SOCKS_SCHEMES' do
schemes = Faraday::Adapter::NetHttpSocks... |
0 | code_files/vets-api-private/spec/lib | code_files/vets-api-private/spec/lib/central_mail/service_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'central_mail/service'
require 'securerandom'
# Re-recording VCR Cassettes
# 1. Replace "<CENTRAL_MAIL_TOKEN>" with Settings.central_mail.upload.token from Staging
# 2. Delete exsiting cassette file
# 3. Re-run spec
RSpec.describe CentralMail::Service do
... |
0 | code_files/vets-api-private/spec/lib | code_files/vets-api-private/spec/lib/central_mail/upload_error_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'central_mail/upload_error'
RSpec.describe CentralMail::UploadError do
before { expect(StatsD).to receive(:increment).with('api.central_mail.upload.fail', { tags: ["status:#{code}"] }) }
let(:message) {}
let(:code) {}
let(:detail) {}
let(:pdf_val... |
0 | code_files/vets-api-private/spec/lib | code_files/vets-api-private/spec/lib/rx/client_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'rx/client'
require 'vets/collection'
require 'rx/configuration'
# Mock upstream request to return source app for Rx client
class UpstreamRequest
def self.env
{ 'SOURCE_APP' => 'myapp' }
end
end
describe Rx::Client do
before do
VCR.use_casset... |
0 | code_files/vets-api-private/spec/lib | code_files/vets-api-private/spec/lib/rx/RECORDING_RX_CASSETTES.md | # Recording RX Cassettes
This document outlines the steps required to successfully record VCR cassettes for RX (prescription) related tests.
## Prerequisites
Before recording RX cassettes, you need to set up the proper configuration to connect to the staging MHV (My HealtheVet) services.
## Steps to Record RX Casse... |
0 | code_files/vets-api-private/spec/lib | code_files/vets-api-private/spec/lib/rx/client_request_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'rx/client'
# These tests are being added to test error handling added to the Rx::Client
# that impacts several endpoints spread across multiple engines and controllers.
# Unit testing on the Rx::Client proved inadequate because our error handling
# is deep... |
0 | code_files/vets-api-private/spec/lib | code_files/vets-api-private/spec/lib/rx/configuration_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'rx/configuration'
RSpec.describe Rx::Configuration do
let(:configuration) { described_class.instance }
describe '#app_token' do
it 'returns the app token from settings' do
allow(Settings.mhv.rx).to receive(:app_token).and_return('test_token'... |
0 | code_files/vets-api-private/spec/lib | code_files/vets-api-private/spec/lib/logging/monitor_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'logging/monitor'
RSpec.describe Logging::Monitor do
let(:service) { 'test-application' }
let(:allowlist) { %w[user_account_uuid document_id error errors tags form_id claim_id confirmation_number] }
let(:monitor) { described_class.new(service, allowli... |
0 | code_files/vets-api-private/spec/lib | code_files/vets-api-private/spec/lib/logging/third_party_transaction_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'logging/third_party_transaction'
module TestObjectContent
extend Logging::ThirdPartyTransaction::MethodWrapper
wrap_with_logging(
:method_to_wrap,
additional_class_logs: { foo: 'bar' },
additional_instance_logs: {
i_work: %i[happy_in... |
0 | code_files/vets-api-private/spec/lib | code_files/vets-api-private/spec/lib/logging/base_monitor_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'logging/base_monitor'
class TestMonitor < Logging::BaseMonitor
def service_name
'TestService'
end
def claim_stats_key
'test.claim.stats'
end
def submission_stats_key
'test.submission.stats'
end
def name
'TestName'
end
... |
0 | code_files/vets-api-private/spec/lib | code_files/vets-api-private/spec/lib/logging/call_location_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'logging/call_location'
RSpec.describe Logging::CallLocation do
let(:call_location) { described_class.new('fake_func', 'fake_file', 'fake_line_42') }
describe 'Logging::CallLocation' do
it 'responds to and returns expected values' do
expect(c... |
0 | code_files/vets-api-private/spec/lib/logging | code_files/vets-api-private/spec/lib/logging/helper/data_scrubber_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'logging/helper/data_scrubber'
RSpec.describe Logging::Helper::DataScrubber do
let(:redaction) { '[REDACTED]' }
describe '.scrub' do
context 'with string data' do
# Test cases: [input, expected_output]
pii_test_cases = [
# SSNs
... |
0 | code_files/vets-api-private/spec/lib/logging | code_files/vets-api-private/spec/lib/logging/helper/parameter_filter_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'logging/helper/parameter_filter'
RSpec.describe Logging::Helper::ParameterFilter do
let(:allowlist) { %w[action class controller errors id status] }
describe '.filter_params' do
it 'filters sensitive values from a hash' do
params = { passwor... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.