Skip to content

Commit

Permalink
fix: survey_bug spec to wait for the answer text
Browse files Browse the repository at this point in the history
  • Loading branch information
Formasitchijoh committed Feb 25, 2025
1 parent 220e9ba commit 3f3738a
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions spec/features/survey_bugs_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@
end

it 'handles changes in condition questions' do
pending 'This sometimes fails for unknown reasons.'

visit survey_path(@survey)

Expand All @@ -100,7 +99,6 @@
end

expect(page).to have_content('Submit Survey')

# Now go back to the previous question
within('div[data-progress-index="4"]') do
click_button('Previous', visible: true) # Q4
Expand All @@ -114,7 +112,6 @@
end

sleep 1

# Now go back to the previous question
within('div[data-progress-index="4"]') do
click_button('Previous', visible: true) # Q3
Expand All @@ -128,16 +125,14 @@
click_button('Next', visible: true) # Q2
end

sleep 2
expect(page).to have_content('Submit Survey')

# Now we can actually submit the survey
# and finish.
expect(page).to have_field("answer_group_#{Rapidfire::Question.last.id}_answer_text")
fill_in("answer_group_#{Rapidfire::Question.last.id}_answer_text", with: 'Done!')
expect(page).to have_content('Submit Survey')
click_button('Submit Survey', visible: true)
expect(page).to have_content 'You made it!'

pass_pending_spec
end
end
end

0 comments on commit 3f3738a

Please sign in to comment.