Skip to content

Commit

Permalink
Merge pull request #2425 from alphagov/fix-flakey-test-in-users-helpe…
Browse files Browse the repository at this point in the history
…r-test

Fix non-deterministic test in UsersHelperTest
  • Loading branch information
floehopper authored Oct 11, 2023
2 parents 42b2e27 + 78b000f commit 696db11
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/helpers/users_helper_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ class UsersHelperTest < ActionView::TestCase
should "return permission options suitable for checkboxes component" do
application = create(:application)
signin_permission = application.signin_permission
permission1 = create(:supported_permission, application:)
permission2 = create(:supported_permission, application:)
permission1 = create(:supported_permission, application:, name: "permission1")
permission2 = create(:supported_permission, application:, name: "permission2")

user = create(:user, supported_permissions: [signin_permission, permission1])

Expand All @@ -96,14 +96,14 @@ class UsersHelperTest < ActionView::TestCase
{
id: supported_permission_checkbox_id(application, permission1),
name: "user[supported_permission_ids][]",
label: permission1.name,
label: "permission1",
value: permission1.id,
checked: true,
},
{
id: supported_permission_checkbox_id(application, permission2),
name: "user[supported_permission_ids][]",
label: permission2.name,
label: "permission2",
value: permission2.id,
checked: false,
},
Expand Down

0 comments on commit 696db11

Please sign in to comment.