Skip to content

Commit

Permalink
Merge pull request #3278 from nebulab/kennyadsl/fix-flaky-attempt
Browse files Browse the repository at this point in the history
Attempt to fix flaky specs
  • Loading branch information
kennyadsl authored Aug 9, 2019
2 parents 43c8921 + 401278d commit 349aa09
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion backend/spec/features/admin/orders/new_refund_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
fill_in 'refund_amount', with: amount
select reason.name, from: 'Reason'
click_button 'Refund'
expect(find('input[type="submit"]')).to be_disabled
expect(page).to have_button('Refund', disabled: true)
end
end
end
10 changes: 8 additions & 2 deletions backend/spec/features/admin/products/edit/taxons_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,19 @@ def assert_selected_taxons(taxons)
visit spree.edit_admin_product_path(product)

assert_selected_taxons([taxon_1])

select2_search "Clothing", from: "Taxon"
assert_selected_taxons([taxon_1, taxon_2])

# Without this line we have a flaky spec probably due to select2 not
# closing its fixed overlay correctly. Clicking anywhere in the page
# before submit apparently solves the issue.
find('.edit_product', visible: true, obscured: false).click

click_button "Update"

expect(find(".flash")).to have_text "Product \"#{product.name}\" has been successfully updated!"
within('.flash') do
expect(page).to have_content(%(Product "#{product.name}" has been successfully updated!))
end
assert_selected_taxons([taxon_1, taxon_2])
end

Expand Down

0 comments on commit 349aa09

Please sign in to comment.