Skip to content

Commit

Permalink
test gem
Browse files Browse the repository at this point in the history
  • Loading branch information
E-L-T committed Oct 14, 2022
1 parent e4ceaa1 commit a20c83c
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ group :test do
gem 'launchy'
gem 'rails-controller-testing'
gem 'rspec_junit_formatter'
gem 'rspec-retry'
gem 'selenium-webdriver'
gem 'shoulda-matchers', require: false
gem 'timecop'
Expand Down
3 changes: 3 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,8 @@ GEM
rspec-expectations (~> 3.10)
rspec-mocks (~> 3.10)
rspec-support (~> 3.10)
rspec-retry (0.6.2)
rspec-core (> 3.3)
rspec-support (3.10.2)
rspec_junit_formatter (0.4.1)
rspec-core (>= 2, < 4, != 2.12.0)
Expand Down Expand Up @@ -896,6 +898,7 @@ DEPENDENCIES
rgeo-geojson
rqrcode
rspec-rails
rspec-retry
rspec_junit_formatter
rubocop
rubocop-performance
Expand Down
16 changes: 16 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# users commonly want.
#
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
require 'rspec/retry'

RSpec.configure do |config|
config.filter_run_excluding disable: true
Expand Down Expand Up @@ -59,3 +60,18 @@
end
end
end

RSpec.configure do |config|
# show retry status in spec process
config.verbose_retry = true
# show exception that triggers a retry if verbose_retry is set to true
config.display_try_failure_messages = true

# callback to be run between retries
config.retry_callback = proc do |ex|
# run some additional clean up task - can be filtered by example metadata
if ex.metadata[:js]
Capybara.reset!
end
end
end
2 changes: 1 addition & 1 deletion spec/system/users/brouillon_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
let(:user_dossier) { user.dossiers.first }
let!(:dossier_to_link) { create(:dossier) }

scenario 'fill a dossier', js: true do
scenario 'fill a dossier', js: true, retry: 3 do
log_in(user, procedure)

fill_individual
Expand Down

0 comments on commit a20c83c

Please sign in to comment.