Skip to content

Commit f57ac15

Browse files
Fix test user
1 parent e14a27f commit f57ac15

File tree

1 file changed

+2
-19
lines changed

1 file changed

+2
-19
lines changed

helpers/helpers.rb

+2-19
Original file line numberDiff line numberDiff line change
@@ -101,25 +101,8 @@ def ensure_test_user_exists
101101

102102
click_on 'Create Account', match: :first
103103

104-
if page.has_text? "Username - Username 'test' is already in use"
105-
visit STAFF_URL
106-
107-
return nil
108-
end
109-
110-
visit "#{STAFF_URL}/users/manage_access"
111-
112-
rows = all('tr', text: 'test')
113-
expect(rows.length).to eq 1
114-
115-
within rows[0] do
116-
click_on 'Edit Groups'
117-
end
118-
119-
unless find('#repository-advanced-data-entry').checked?
120-
check 'repository-advanced-data-entry'
121-
click_on 'Update Account'
122-
end
104+
raise 'Could not create test user' if page.has_text?('User not created') &&
105+
!page.has_text?("Username - Username 'test' is already in use")
123106

124107
visit STAFF_URL
125108
end

0 commit comments

Comments
 (0)