Skip to content

Commit b46ddbd

Browse files
committed
HOMS-523 Guard each sign-in field independently
Email and Password are re-driven separately, so a value that failed to stick in one field no longer depends on the other field having failed too.
1 parent 2b06552 commit b46ddbd

2 files changed

Lines changed: 9 additions & 8 deletions

File tree

Dockerfile.oracle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ RUN seq 1 8 | xargs -I{} mkdir -p /usr/share/man/man{} && \
3636
telnet \
3737
unzip
3838

39-
RUN npm install -g yarn && yarn set version stable
39+
RUN npm install -g corepack@latest && corepack enable
4040

4141
WORKDIR /opt/oracle
4242

spec/support/helpers/sessions_helper.rb

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,16 @@ def sign_up_with(email, password, confirmation, name, middle_name,
1717

1818
# rubocop:enable Metrics/ParameterLists
1919
def signin(email, password)
20-
visit new_user_session_path
21-
fill_in 'Email', with: email
22-
fill_in 'Password', with: password
2320
# Also the path for the invalid-credentials specs, so this must assert nothing about the
24-
# sign-in outcome — only that the typed value actually stuck before submitting.
25-
unless page.has_field?('Email', with: email)
26-
fill_in 'Email', with: email
27-
fill_in 'Password', with: password
21+
# sign-in outcome — only that each typed value actually stuck before submitting.
22+
fill = lambda do |field, value|
23+
fill_in field, with: value
24+
fill_in field, with: value unless page.has_field?(field, with: value)
2825
end
26+
27+
visit new_user_session_path
28+
fill.call('Email', email)
29+
fill.call('Password', password)
2930
click_button 'Sign in'
3031
end
3132

0 commit comments

Comments
 (0)