-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Reduce the stubbed API data to make it simpler to read, while still containing the required data and leaving a comment so future Devs don't think it's representative of a full data response * Simplify the creation tests to be clear what is being looked for
- Loading branch information
1 parent
fec1668
commit c3aabb0
Showing
1 changed file
with
11 additions
and
49 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -70,10 +70,9 @@ | |
|
||
it "updates the record with firm and offices" do | ||
post_request | ||
firm = Firm.find_by(ccms_id: raw_details_response.dig(:firm, :ccmsFirmId)) | ||
expect(provider.firm_id).to eq firm.id | ||
expect(firm.offices.size).to eq 1 | ||
expect(firm.offices.first.ccms_id).to eq raw_details_response[:officeCodes].first[:ccmsFirmOfficeId].to_s | ||
expect(provider.firm.ccms_id).to eq "10835831" | ||
expect(provider.firm.offices.size).to eq 1 | ||
expect(provider.firm.offices.first.ccms_id).to eq "34406595" | ||
end | ||
|
||
context "when mock_saml is activated" do | ||
|
@@ -181,10 +180,9 @@ | |
|
||
it "updates the record with firm and offices" do | ||
post_request | ||
firm = Firm.find_by(ccms_id: raw_details_response.dig(:firm, :ccmsFirmId)) | ||
expect(provider.firm_id).to eq firm.id | ||
expect(firm.offices.size).to eq 1 | ||
expect(firm.offices.first.ccms_id).to eq raw_details_response[:officeCodes].first[:ccmsFirmOfficeId].to_s | ||
expect(provider.firm.ccms_id).to eq "10835831" | ||
expect(provider.firm.offices.size).to eq 1 | ||
expect(provider.firm.offices.first.ccms_id).to eq "34406595" | ||
end | ||
|
||
it "displays the start page" do | ||
|
@@ -226,25 +224,17 @@ def raw_details_response | |
{ | ||
firm: { | ||
firmId: 3_959_183, | ||
firmNumber: "50736", | ||
ccmsFirmId: 10_835_831, | ||
firmName: "DT SCRIPT PROVIDER 1", | ||
# trimmed for stub usage | ||
}, | ||
user: { | ||
userId: 454_031, | ||
ccmsContactId: 0, | ||
userLogin: "DT_SCRIPT_USER1", | ||
name: "Dts User1", | ||
emailAddress: "[email protected]", | ||
portalStatus: "Active", | ||
# trimmed for stub usage | ||
}, | ||
officeCodes: [ | ||
{ | ||
firmOfficeId: 145_434, | ||
ccmsFirmOfficeId: 34_406_595, | ||
firmOfficeCode: "2Q242F", | ||
officeName: "2Q242F,1 Skyscraper", | ||
officeCodeAlt: "DT Script Office 1", | ||
# trimmed for stub usage | ||
}, | ||
], | ||
} | ||
|
@@ -254,42 +244,14 @@ def firm_response | |
{ | ||
firm: { | ||
firmId: 3_959_183, | ||
firmNumber: "50736", | ||
ccmsFirmId: 10_835_831, | ||
firmName: "DT SCRIPT PROVIDER 1", | ||
# trimmed for stub usage | ||
}, | ||
offices: [ | ||
{ | ||
firmOfficeId: 145_434, | ||
ccmsFirmOfficeId: 34_406_595, | ||
firmOfficeCode: "2Q242F", | ||
officeName: "2Q242F,1 Skyscraper", | ||
officeCodeAlt: "DT Script Office 1", | ||
addressLine1: "1 Skyscraper", | ||
addressLine2: "1 Some Road", | ||
addressLine3: "", | ||
addressLine4: "", | ||
city: "Metropolis", | ||
county: "", | ||
postCode: "LE1 1AA", | ||
dxCentre: "", | ||
dxNumber: "", | ||
telephoneAreaCode: "01162", | ||
telephoneNumber: "555124", | ||
faxAreaCode: "", | ||
faxNumber: "", | ||
emailAddress: "[email protected]", | ||
vatRegistrationNumber: "", | ||
type: "Legal Services Provider", | ||
headOffice: "N/A", | ||
creationDate: "2023-11-10", | ||
lscRegion: "Midlands", | ||
lscBidZone: "Leicester", | ||
lscAreaOffice: "Nottingham", | ||
cjsForceName: "Leicestershire", | ||
localAuthority: "City of Leicester", | ||
policeStationAreaName: "Leicester", | ||
dutySolicitorAreaName: "Leicester", | ||
# trimmed for stub usage | ||
}, | ||
], | ||
} | ||
|