Skip to content

Commit

Permalink
Merge pull request #3196 from DFE-Digital/provider-verification-task-…
Browse files Browse the repository at this point in the history
…bug-fix

Fix find or create for provider
  • Loading branch information
rjlynch authored Sep 17, 2024
2 parents 1199dd5 + 2824155 commit 822094c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,13 @@ def verifier
end

def created_by
DfeSignIn::User.find_or_create_by!(
dfe_sign_in_id: verifier.fetch("dfe_sign_in_uid"),
given_name: verifier.fetch("first_name"),
family_name: verifier.fetch("last_name"),
email: verifier.fetch("email"),
organisation_name: verifier.fetch("dfe_sign_in_organisation_name"),
role_codes: verifier.fetch("dfe_sign_in_role_codes")
)
DfeSignIn::User.find_or_create_by!(dfe_sign_in_id: verifier.fetch("dfe_sign_in_uid")) do |user|
user.given_name = verifier.fetch("first_name")
user.family_name = verifier.fetch("last_name")
user.email = verifier.fetch("email")
user.organisation_name = verifier.fetch("dfe_sign_in_organisation_name")
user.role_codes = verifier.fetch("dfe_sign_in_role_codes")
end
end
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,7 @@
it "does not create a new verifier" do
dfe_sign_in_user = create(
:dfe_signin_user,
dfe_sign_in_id: "123",
given_name: "Seymour",
family_name: "Skinner",
email: "[email protected]",
organisation_name: "Springfield Elementary",
role_codes: ["teacher_payments_claim_verifier"]
dfe_sign_in_id: "123"
)

claim = create(
Expand Down

0 comments on commit 822094c

Please sign in to comment.