Skip to content

Commit

Permalink
Update workflow to run seeds
Browse files Browse the repository at this point in the history
  • Loading branch information
richardpattinson committed Sep 16, 2024
1 parent fa5eec3 commit a57403e
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 25 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,21 @@ jobs:
azure-credentials: ${{ secrets.AZURE_CREDENTIALS }}
pull-request-number: ${{ github.event.number }}

- uses: azure/login@v2
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}

- name: Set kubelogin environment
uses: DFE-Digital/github-actions/set-kubelogin-environment@master
with:
azure-credentials: ${{ secrets.AZURE_CREDENTIALS }}

- name: Seed role codes
shell: bash
run: |
make ci aks-review get-cluster-credentials PR_NUMBER=123
kubectl exec -n tra-development deployment/access-your-teaching-qualifications-pr-${{ github.event.number }} -- /bin/sh -c "cd /app && bundle exec rake db:seed_role_codes"
- name: Post comment to Pull Request ${{ github.event.number }}
uses: marocchino/sticky-pull-request-comment@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ gem "bootsnap", require: false
gem "console1984"
gem "cssbundling-rails"
gem "data_migrate", github: "ilyakatz/data-migrate"
gem "dfe-analytics", github: "DFE-Digital/dfe-analytics", tag: "v1.14.1"
gem "dfe-analytics", github: "DFE-Digital/dfe-analytics", tag: "v1.14.2"
gem "faraday"
gem "govuk-components", "~> 5.6"
gem "govuk_design_system_formbuilder", "~> 5.6"
Expand Down
6 changes: 3 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
GIT
remote: https://github.com/DFE-Digital/dfe-analytics.git
revision: 79378cc466a40c6a6cba317e232cbf48ec79ab7d
tag: v1.14.1
revision: 706595e52fed211cee53ad99ceaeaabb47a059cc
tag: v1.14.2
specs:
dfe-analytics (1.14.1)
dfe-analytics (1.14.2)
google-cloud-bigquery (~> 1.38)
httparty (~> 0.21)
multi_xml (~> 0.6.0)
Expand Down
5 changes: 0 additions & 5 deletions app/lib/qualifications_api/teacher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ def qualifications

def restriction_status
return 'No restrictions' if no_restrictions?
return 'Possible restrictions' if possible_restrictions?

'Restriction'
end
Expand All @@ -52,10 +51,6 @@ def no_restrictions?
false
end

def possible_restrictions?
sanctions.any?(&:possible_match_on_childrens_barred_list?)
end

def sanctions
api_data.sanctions&.map { |sanction| Sanction.new(sanction) }
end
Expand Down
10 changes: 0 additions & 10 deletions app/models/sanction.rb
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,6 @@ def initialize(api_data)
Call the Teaching Regulation Agency (TRA) on 0207 593 5393 for more information.
DESCRIPTION
},
"G1" => {
title: "Possible match on the children’s barred list",
description: <<~DESCRIPTION.chomp
Email the Disclosure and Barring Service (DBS) at [[email protected]](mailto:[email protected]) to check if this person is allowed to work with children.
DESCRIPTION
},
"T1" => {
title: "Prohibition order",
description: <<~DESCRIPTION.chomp
Expand Down Expand Up @@ -235,10 +229,6 @@ def title
SANCTIONS[code][:title] if SANCTIONS[code]
end

def possible_match_on_childrens_barred_list?
code == "G3"
end

def guilty_but_not_prohibited?
code == "T6"
end
Expand Down
5 changes: 2 additions & 3 deletions spec/models/sanction_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,11 @@
subject(:description) { sanction.description }

context 'when type exists in SANCTIONS' do
let(:code) { "G1" }
let(:code) { "A13" }

it "returns the description as markdown" do
expect(description)
.to eq('Email the Disclosure and Barring Service (DBS) at [[email protected]](mailto:[email protected]) ' \
'to check if this person is allowed to work with children.')
.to include('Suspended by the General Teaching Council for England.')
end
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
then_i_see_the_restriction_on_the_result

when_i_click_on_the_result
then_i_see_the_details_of_the_restriction
then_i_see_the_details_of_the_record
end

private
Expand All @@ -35,8 +35,7 @@ def when_i_click_on_the_result
click_link "Teacher Restricted"
end

def then_i_see_the_details_of_the_restriction
expect(page).to have_content("Possible match on the children’s barred list")
def then_i_see_the_details_of_the_record
expect(page).to have_title("Terry Walsh - Check a teacher’s record")
end
end

0 comments on commit a57403e

Please sign in to comment.