Skip to content

Commit

Permalink
changes in spec attempting to deal with modal not appearing. #881
Browse files Browse the repository at this point in the history
  • Loading branch information
mattbaumann1 committed Dec 13, 2021
1 parent 6f214f8 commit 482766e
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,27 @@ def requires_option_text

context 'edit' do
scenario 'requires at least one option' do
@grant.questions.where(response_type: 'pick_one').last.multiple_choice_options.count.times do
# Capybara.ignore_hidden_elements = false
options = @grant.questions.where(response_type: 'pick_one').last.multiple_choice_options
first_option = options.first
options.count.times do
accept_alert do
find('.delete-option', match: :first).click
# page.find("#delete-option-#{first_option.id}", visible: all).click
page.find("#delete-option-#{first_option.id}").click
end
end
click_button 'Save'
expect(page).to have_text requires_option_text
find('.add-option').click
click_button 'Save'
expect(page).to have_text 'Multiple Choice Option text cannot be empty'
# Capybara.ignore_hidden_elements = false
end

scenario 'requires text' do
@grant.questions.where(response_type: 'pick_one').last.multiple_choice_options.count.times do
accept_alert do
find('.delete-option', match: :first).click
page.find("#delete-option-#{first_option.id}", :visible => false).click
end
end
find('.add-option').click
Expand Down

0 comments on commit 482766e

Please sign in to comment.