Skip to content

Commit d7191a4

Browse files
authored
Merge pull request #528 from alphagov/fix-domain-list-hints
Clarify hints for domain lists
2 parents bdb3571 + e724276 commit d7191a4

2 files changed

Lines changed: 31 additions & 3 deletions

File tree

app/views/admin/rate_limits/edit.html.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
<%= form_row for: [form.object, :domain_whitelist] do %>
4545
<%= error_messages_for_field @rate_limit, :domain_whitelist %>
4646
<%= form.text_area :domain_whitelist, tabindex: increment, rows: 15, class: 'form-control' %>
47-
<p><small>use *.example.com or **.example.com for wildcard matching</small><p>
47+
<p><small>use *.example.com to match one subdomain and **.example.com to match nested subdomains</small><p>
4848
<% end %>
4949

5050
<% elsif params[:tab] == "domain_blacklist" %>
@@ -53,7 +53,7 @@
5353
<%= form_row for: [form.object, :domain_blacklist] do %>
5454
<%= error_messages_for_field @rate_limit, :domain_blacklist %>
5555
<%= form.text_area :domain_blacklist, tabindex: increment, rows: 15, class: 'form-control' %>
56-
<p><small>use *.example.com or **.example.com for wildcard matching</small><p>
56+
<p><small>use *.example.com to match one subdomain and **.example.com to match nested subdomains</small><p>
5757
<% end %>
5858

5959
<% elsif params[:tab] == "ip_whitelist" %>

features/admin/updating_rate_limits.feature

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,28 @@ Feature: Sysadmin updates the rate limits
2323
And I follow "Rate Limits"
2424
Then I should see "Edit Rate Limits"
2525
When I follow "Domain Whitelist"
26-
Then I should see "use *.example.com or **.example.com for wildcard matching"
26+
Then I should see "use *.example.com to match one subdomain and **.example.com to match nested subdomains"
2727
When I fill in "rate_limit_domain_whitelist" with "foo("
2828
And I press "Save"
2929
Then I should see "Domain whitelist is invalid"
3030
When I fill in "rate_limit_domain_whitelist" with "example.com"
3131
And I press "Save"
3232
Then I should see "Rate limits updated successfully"
3333

34+
Scenario: Sysadmin updates the domain blacklist
35+
When I am logged in as a sysadmin
36+
And I am on the admin home page
37+
And I follow "Rate Limits"
38+
Then I should see "Edit Rate Limits"
39+
When I follow "Domain Blacklist"
40+
Then I should see "use *.example.com to match one subdomain and **.example.com to match nested subdomains"
41+
When I fill in "rate_limit_domain_blacklist" with "foo("
42+
And I press "Save"
43+
Then I should see "Domain blacklist is invalid"
44+
When I fill in "rate_limit_domain_blacklist" with "example.com"
45+
And I press "Save"
46+
Then I should see "Rate limits updated successfully"
47+
3448
Scenario: Sysadmin updates the IP whitelist
3549
When I am logged in as a sysadmin
3650
And I am on the admin home page
@@ -44,3 +58,17 @@ Feature: Sysadmin updates the rate limits
4458
When I fill in "rate_limit_ip_whitelist" with "127.0.0.1/32"
4559
And I press "Save"
4660
Then I should see "Rate limits updated successfully"
61+
62+
Scenario: Sysadmin updates the IP whitelist
63+
When I am logged in as a sysadmin
64+
And I am on the admin home page
65+
And I follow "Rate Limits"
66+
Then I should see "Edit Rate Limits"
67+
When I follow "IP Blacklist"
68+
Then I should see "use CIDR addressing to match ranges, e.g. 192.168.0.0/24"
69+
When I fill in "rate_limit_ip_blacklist" with "127"
70+
And I press "Save"
71+
Then I should see "IP blacklist is invalid"
72+
When I fill in "rate_limit_ip_blacklist" with "127.0.0.1/32"
73+
And I press "Save"
74+
Then I should see "Rate limits updated successfully"

0 commit comments

Comments
 (0)