Skip to content

Commit 35932b1

Browse files
committed
Specs: Wait for successful login before navigation
Without this change, the new path might be visited before the login succeeded. This causes authorization issues, where another login screen was shown.
1 parent 5f6b43d commit 35932b1

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

spec/system/editor_system_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
fill_in('email', with: contributor.email)
3131
fill_in('password', with: attributes_for(:teacher)[:password])
3232
click_button(I18n.t('sessions.new.link'))
33+
has_content?(I18n.t('sessions.create.success'))
3334
allow_any_instance_of(LtiHelper).to receive(:lti_outcome_service?).and_return(true)
3435
visit(implement_exercise_path(exercise))
3536
end

spec/system/external_user_statistics_system_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@
2222
fill_in('email', with: user.email)
2323
fill_in('password', with: password)
2424
click_button(I18n.t('sessions.new.link'))
25-
wait_for_ajax
25+
has_content?(I18n.t('sessions.create.success'))
2626
allow_any_instance_of(LtiHelper).to receive(:lti_outcome_service?).and_return(true)
2727
visit(statistics_external_user_exercise_path(id: exercise.id, external_user_id: learner.id))
2828
end
2929

30-
context 'when a admin accesses the page' do
30+
context 'when an admin accesses the page' do
3131
let(:user) { create(:admin, password:) }
3232

3333
it 'does display the option to enable autosaves' do

spec/system/request_for_comments_filter_system_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
fill_in('email', with: user.email)
1111
fill_in('password', with: attributes_for(:teacher)[:password])
1212
click_button(I18n.t('sessions.new.link'))
13+
has_content?(I18n.t('sessions.create.success'))
1314
end
1415

1516
it 'does not contain rfcs for unpublished exercises' do

0 commit comments

Comments
 (0)