Skip to content

Commit

Permalink
test: fix system tests (#97)
Browse files Browse the repository at this point in the history
  • Loading branch information
kadru committed Oct 8, 2023
1 parent db719cc commit 7c234a4
Show file tree
Hide file tree
Showing 4 changed files with 93 additions and 97 deletions.
4 changes: 1 addition & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ gem 'pagy'
gem 'pg', '>= 0.18', '< 2.0'
gem 'pg_search'
gem 'puma', '~> 5.6'
gem 'rails', '~> 7.0'
gem 'rails', '~> 7.0.4'
gem 'sass-rails', '>= 6'
gem 'sequel', require: false
gem 'sequel_pg', require: false
Expand Down Expand Up @@ -51,11 +51,9 @@ group :test do
gem 'capybara', '~> 3.30'
gem 'database_cleaner', '~> 1.7.0'
gem 'factory_bot_rails'
# gem 'rspec-benchmark'
gem 'selenium-webdriver', '~> 4.0'
gem 'shoulda-matchers', '~> 4.2.0'
gem 'simplecov', require: false
gem 'simplecov-cobertura', require: false
gem 'webdrivers', '~> 5.0'
gem 'webmock'
end
182 changes: 90 additions & 92 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10,73 +10,73 @@ GIT
GEM
remote: https://rubygems.org/
specs:
actioncable (7.0.4.2)
actionpack (= 7.0.4.2)
activesupport (= 7.0.4.2)
actioncable (7.0.8)
actionpack (= 7.0.8)
activesupport (= 7.0.8)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (7.0.4.2)
actionpack (= 7.0.4.2)
activejob (= 7.0.4.2)
activerecord (= 7.0.4.2)
activestorage (= 7.0.4.2)
activesupport (= 7.0.4.2)
actionmailbox (7.0.8)
actionpack (= 7.0.8)
activejob (= 7.0.8)
activerecord (= 7.0.8)
activestorage (= 7.0.8)
activesupport (= 7.0.8)
mail (>= 2.7.1)
net-imap
net-pop
net-smtp
actionmailer (7.0.4.2)
actionpack (= 7.0.4.2)
actionview (= 7.0.4.2)
activejob (= 7.0.4.2)
activesupport (= 7.0.4.2)
actionmailer (7.0.8)
actionpack (= 7.0.8)
actionview (= 7.0.8)
activejob (= 7.0.8)
activesupport (= 7.0.8)
mail (~> 2.5, >= 2.5.4)
net-imap
net-pop
net-smtp
rails-dom-testing (~> 2.0)
actionpack (7.0.4.2)
actionview (= 7.0.4.2)
activesupport (= 7.0.4.2)
rack (~> 2.0, >= 2.2.0)
actionpack (7.0.8)
actionview (= 7.0.8)
activesupport (= 7.0.8)
rack (~> 2.0, >= 2.2.4)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actiontext (7.0.4.2)
actionpack (= 7.0.4.2)
activerecord (= 7.0.4.2)
activestorage (= 7.0.4.2)
activesupport (= 7.0.4.2)
actiontext (7.0.8)
actionpack (= 7.0.8)
activerecord (= 7.0.8)
activestorage (= 7.0.8)
activesupport (= 7.0.8)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (7.0.4.2)
activesupport (= 7.0.4.2)
actionview (7.0.8)
activesupport (= 7.0.8)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
activejob (7.0.4.2)
activesupport (= 7.0.4.2)
activejob (7.0.8)
activesupport (= 7.0.8)
globalid (>= 0.3.6)
activemodel (7.0.4.2)
activesupport (= 7.0.4.2)
activerecord (7.0.4.2)
activemodel (= 7.0.4.2)
activesupport (= 7.0.4.2)
activestorage (7.0.4.2)
actionpack (= 7.0.4.2)
activejob (= 7.0.4.2)
activerecord (= 7.0.4.2)
activesupport (= 7.0.4.2)
activemodel (7.0.8)
activesupport (= 7.0.8)
activerecord (7.0.8)
activemodel (= 7.0.8)
activesupport (= 7.0.8)
activestorage (7.0.8)
actionpack (= 7.0.8)
activejob (= 7.0.8)
activerecord (= 7.0.8)
activesupport (= 7.0.8)
marcel (~> 1.0)
mini_mime (>= 1.1.0)
activesupport (7.0.4.2)
activesupport (7.0.8)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
addressable (2.8.5)
public_suffix (>= 2.0.2, < 6.0)
argon2 (2.1.0)
ffi (~> 1.14)
ffi-compiler (~> 1.0)
Expand All @@ -87,15 +87,15 @@ GEM
msgpack (~> 1.2)
builder (3.2.4)
byebug (11.1.3)
capybara (3.35.3)
capybara (3.39.2)
addressable
matrix
mini_mime (>= 0.1.3)
nokogiri (~> 1.8)
rack (>= 1.6.0)
rack-test (>= 0.6.3)
regexp_parser (>= 1.5, < 3.0)
xpath (~> 3.2)
childprocess (4.1.0)
chronic (0.10.2)
clearance (2.5.0)
actionmailer (>= 5.0)
Expand Down Expand Up @@ -133,8 +133,8 @@ GEM
ffi-compiler (1.0.1)
ffi (>= 1.0.0)
rake
globalid (1.1.0)
activesupport (>= 5.0)
globalid (1.2.1)
activesupport (>= 6.1)
hashdiff (1.0.1)
honeybadger (4.9.0)
http (4.4.1)
Expand All @@ -147,7 +147,7 @@ GEM
http-form_data (2.3.0)
http-parser (1.2.3)
ffi-compiler (>= 1.0, < 2.0)
i18n (1.12.0)
i18n (1.14.1)
concurrent-ruby (~> 1.0)
json (2.6.3)
launchy (2.5.0)
Expand All @@ -161,9 +161,9 @@ GEM
listen (3.5.1)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
loofah (2.19.1)
loofah (2.21.3)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
nokogiri (>= 1.12.0)
mail (2.8.1)
mini_mime (>= 0.1.1)
net-imap
Expand All @@ -172,20 +172,20 @@ GEM
marcel (1.0.2)
matrix (0.4.2)
method_source (1.0.0)
mini_mime (1.1.2)
minitest (5.17.0)
mini_mime (1.1.5)
minitest (5.20.0)
msgpack (1.6.0)
net-imap (0.3.4)
net-imap (0.4.0)
date
net-protocol
net-pop (0.1.2)
net-protocol
net-protocol (0.2.1)
timeout
net-smtp (0.3.3)
net-smtp (0.4.0)
net-protocol
nio4r (2.5.8)
nokogiri (1.14.2-x86_64-linux)
nio4r (2.5.9)
nokogiri (1.15.4-x86_64-linux)
racc (~> 1.4)
pagy (3.10.0)
parallel (1.22.1)
Expand All @@ -195,37 +195,39 @@ GEM
pg_search (2.3.5)
activerecord (>= 5.2)
activesupport (>= 5.2)
public_suffix (4.0.6)
public_suffix (5.0.3)
puma (5.6.4)
nio4r (~> 2.0)
racc (1.6.2)
rack (2.2.6.3)
racc (1.7.1)
rack (2.2.8)
rack-proxy (0.7.6)
rack
rack-test (2.0.2)
rack-test (2.1.0)
rack (>= 1.3)
rails (7.0.4.2)
actioncable (= 7.0.4.2)
actionmailbox (= 7.0.4.2)
actionmailer (= 7.0.4.2)
actionpack (= 7.0.4.2)
actiontext (= 7.0.4.2)
actionview (= 7.0.4.2)
activejob (= 7.0.4.2)
activemodel (= 7.0.4.2)
activerecord (= 7.0.4.2)
activestorage (= 7.0.4.2)
activesupport (= 7.0.4.2)
rails (7.0.8)
actioncable (= 7.0.8)
actionmailbox (= 7.0.8)
actionmailer (= 7.0.8)
actionpack (= 7.0.8)
actiontext (= 7.0.8)
actionview (= 7.0.8)
activejob (= 7.0.8)
activemodel (= 7.0.8)
activerecord (= 7.0.8)
activestorage (= 7.0.8)
activesupport (= 7.0.8)
bundler (>= 1.15.0)
railties (= 7.0.4.2)
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
railties (= 7.0.8)
rails-dom-testing (2.2.0)
activesupport (>= 5.0.0)
minitest
nokogiri (>= 1.6)
rails-html-sanitizer (1.5.0)
loofah (~> 2.19, >= 2.19.1)
railties (7.0.4.2)
actionpack (= 7.0.4.2)
activesupport (= 7.0.4.2)
rails-html-sanitizer (1.6.0)
loofah (~> 2.21)
nokogiri (~> 1.14)
railties (7.0.8)
actionpack (= 7.0.8)
activesupport (= 7.0.8)
method_source
rake (>= 12.2)
thor (~> 1.0)
Expand All @@ -236,8 +238,8 @@ GEM
rb-inotify (0.10.1)
ffi (~> 1.0)
redis (4.6.0)
regexp_parser (2.7.0)
rexml (3.2.5)
regexp_parser (2.8.1)
rexml (3.2.6)
rspec-core (3.12.1)
rspec-support (~> 3.12.0)
rspec-expectations (3.12.2)
Expand Down Expand Up @@ -288,10 +290,10 @@ GEM
sprockets (> 3.0)
sprockets-rails
tilt
selenium-webdriver (4.1.0)
childprocess (>= 0.5, < 5.0)
selenium-webdriver (4.13.1)
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2)
rubyzip (>= 1.2.2, < 3.0)
websocket (~> 1.0)
semantic_range (3.0.0)
sequel (5.44.0)
sequel_pg (1.14.0)
Expand Down Expand Up @@ -330,9 +332,9 @@ GEM
activesupport (>= 5.2)
sprockets (>= 3.0.0)
temple (0.8.2)
thor (1.2.1)
thor (1.2.2)
tilt (2.0.10)
timeout (0.3.2)
timeout (0.4.0)
turbolinks (5.2.1)
turbolinks-source (~> 5.2)
turbolinks-source (5.2.0)
Expand All @@ -350,22 +352,19 @@ GEM
activemodel (>= 6.0.0)
bindex (>= 0.4.0)
railties (>= 6.0.0)
webdrivers (5.0.0)
nokogiri (~> 1.6)
rubyzip (>= 1.3.0)
selenium-webdriver (~> 4.0)
webmock (3.12.2)
addressable (>= 2.3.6)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
websocket-driver (0.7.5)
websocket (1.2.10)
websocket-driver (0.7.6)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
whenever (1.0.0)
chronic (>= 0.6.3)
xpath (3.2.0)
nokogiri (~> 1.8)
zeitwerk (2.6.7)
zeitwerk (2.6.12)

PLATFORMS
x86_64-linux
Expand All @@ -389,7 +388,7 @@ DEPENDENCIES
pg (>= 0.18, < 2.0)
pg_search
puma (~> 5.6)
rails (~> 7.0)
rails (~> 7.0.4)
rspec-rails (~> 6)
rubocop (~> 1.18)
rubocop-rails (~> 2.18)
Expand All @@ -409,7 +408,6 @@ DEPENDENCIES
turbolinks (~> 5)
view_component (~> 2.49)
web-console (>= 3.3.0)
webdrivers (~> 5.0)
webmock
whenever

Expand Down
2 changes: 1 addition & 1 deletion spec/rails_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@
end

config.before(:all, type: :system) do
WebMock.disable_net_connect!(allow_localhost: true, allow: [/github.com/, /chromedriver.storage.googleapis.com/])
driven_by :rack_test
end

config.before(:all, js: true) do
WebMock.disable_net_connect!(allow_localhost: true)
driven_by :selenium, using: :headless_chrome
end

Expand Down
2 changes: 1 addition & 1 deletion spec/system/clearance/visitor_signs_in_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def create_user(email, password)
end

def expect_page_to_display_sign_in_error
expect(page.body).to include(
expect(page).to have_content(
I18n.t('flashes.failure_after_create', sign_up_path:)
)
end
Expand Down

0 comments on commit 7c234a4

Please sign in to comment.