Skip to content

Commit

Permalink
Improve regex for financial variables check (#4156)
Browse files Browse the repository at this point in the history
* Improves the regex for financial variables check to look for html entities and codes as well as characters

* Added minimum salary variable to salaries-banner
  • Loading branch information
spencerldixon authored Aug 28, 2024
1 parent 9f173a2 commit 74b50d5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/views/content/home/_salaries-banner.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div id="salary-banner" class="banner">
<%= render CallsToAction::SimpleComponent.new(icon: "icon-money") do %>
<h2 class="call-to-action__heading">Earn a minimum of &pound;30k a year</h2>
<h2 class="call-to-action__heading">Earn a minimum of <%= v :salaries_starting_minshortened %> a year</h2>
<p>All qualified teachers get a <strong>minimum starting salary of <%= v :salaries_starting_minshortened %></strong> (or higher in London), so it pays to do what you love.</p>
<p>And with lots of opportunities to progress, you could <strong>earn over <%= v :salaries_fiveyears_maxshortened %> within 5 years</strong>.</p>
<p><%= link_to("Find out more about teacher pay", page_path("life-as-a-teacher/pay-and-benefits/teacher-pay")) %>.</p>
Expand Down
2 changes: 1 addition & 1 deletion spec/support/page_testing_support.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,5 +111,5 @@ def build_url(host, link)
end

class MonetaryChecker
MONEY_REGEXP = /([$£€]\d+(,\d{3})*([.,]\d{1,2}p?)?k?)/m
MONEY_REGEXP = /(([$£€]|&dollar;|&pound;|&euro;|&#36;|&#163;|&#8364;)\d+(,\d{3})*([.,]\d{1,2}p?)?k?)/m
end

0 comments on commit 74b50d5

Please sign in to comment.