diff --git a/Gemfile b/Gemfile index 03b5283d2..ad31a9b7a 100644 --- a/Gemfile +++ b/Gemfile @@ -2,7 +2,7 @@ source 'https://rubygems.org' -gem 'rails', '7.0.4.2' +gem 'rails', '7.0.5' gem 'active_model_serializers' gem 'activerecord-postgresql-adapter' @@ -51,7 +51,7 @@ group :development, :test do gem 'byebug', platform: :mri gem 'pry' gem 'pry-byebug' - gem 'rspec-rails', '~> 4.0.2' + gem 'rspec-rails' end group :development do @@ -66,7 +66,9 @@ group :development do end group :test do + gem 'capybara' gem 'simplecov' + gem 'webdrivers', '~> 5.3', '>= 5.3.1', require: false end # Windows does not include zoneinfo files, so bundle the tzinfo-data gem gem 'tzinfo-data', platforms: %i[mingw mswin x64_mingw jruby] diff --git a/Gemfile.lock b/Gemfile.lock index 571bf7021..3a1a566dc 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,47 +1,47 @@ GEM remote: https://rubygems.org/ specs: - actioncable (7.0.4.2) - actionpack (= 7.0.4.2) - activesupport (= 7.0.4.2) + actioncable (7.0.5) + actionpack (= 7.0.5) + activesupport (= 7.0.5) 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.5) + actionpack (= 7.0.5) + activejob (= 7.0.5) + activerecord (= 7.0.5) + activestorage (= 7.0.5) + activesupport (= 7.0.5) 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.5) + actionpack (= 7.0.5) + actionview (= 7.0.5) + activejob (= 7.0.5) + activesupport (= 7.0.5) 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.5) + actionview (= 7.0.5) + activesupport (= 7.0.5) + 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.5) + actionpack (= 7.0.5) + activerecord (= 7.0.5) + activestorage (= 7.0.5) + activesupport (= 7.0.5) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.0.4.2) - activesupport (= 7.0.4.2) + actionview (7.0.5) + activesupport (= 7.0.5) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) @@ -51,24 +51,24 @@ GEM activemodel (>= 4.1) case_transform (>= 0.2) jsonapi-renderer (>= 0.1.1.beta1, < 0.3) - activejob (7.0.4.2) - activesupport (= 7.0.4.2) + activejob (7.0.5) + activesupport (= 7.0.5) 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) + activemodel (7.0.5) + activesupport (= 7.0.5) + activerecord (7.0.5) + activemodel (= 7.0.5) + activesupport (= 7.0.5) activerecord-postgresql-adapter (0.0.1) pg - 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) + activestorage (7.0.5) + actionpack (= 7.0.5) + activejob (= 7.0.5) + activerecord (= 7.0.5) + activesupport (= 7.0.5) marcel (~> 1.0) mini_mime (>= 1.1.0) - activesupport (7.0.4.2) + activesupport (7.0.5) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) @@ -90,6 +90,15 @@ GEM activesupport (>= 3.0.0) uniform_notifier (~> 1.11) byebug (11.1.3) + capybara (3.40.0) + addressable + matrix + mini_mime (>= 0.1.3) + nokogiri (~> 1.11) + rack (>= 1.6.0) + rack-test (>= 0.6.3) + regexp_parser (>= 1.5, < 3.0) + xpath (~> 3.2) carrierwave (2.2.5) activemodel (>= 5.0.0) activesupport (>= 5.0.0) @@ -214,6 +223,7 @@ GEM net-pop net-smtp marcel (1.0.2) + matrix (0.4.2) method_source (1.0.0) mime-types (3.4.1) mime-types-data (~> 3.2015) @@ -265,20 +275,20 @@ GEM rack (2.2.6.4) rack-test (1.1.0) rack (>= 1.0, < 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.5) + actioncable (= 7.0.5) + actionmailbox (= 7.0.5) + actionmailer (= 7.0.5) + actionpack (= 7.0.5) + actiontext (= 7.0.5) + actionview (= 7.0.5) + activejob (= 7.0.5) + activemodel (= 7.0.5) + activerecord (= 7.0.5) + activestorage (= 7.0.5) + activesupport (= 7.0.5) bundler (>= 1.15.0) - railties (= 7.0.4.2) + railties (= 7.0.5) rails-dom-testing (2.2.0) activesupport (>= 5.0.0) minitest @@ -294,9 +304,9 @@ GEM rails-i18n (7.0.6) i18n (>= 0.7, < 2) railties (>= 6.0.0, < 8) - railties (7.0.4.2) - actionpack (= 7.0.4.2) - activesupport (= 7.0.4.2) + railties (7.0.5) + actionpack (= 7.0.5) + activesupport (= 7.0.5) method_source rake (>= 12.2) thor (~> 1.0) @@ -357,6 +367,10 @@ GEM seed-fu (2.3.9) activerecord (>= 3.1) activesupport (>= 3.1) + selenium-webdriver (4.10.0) + rexml (~> 3.2, >= 3.2.5) + rubyzip (>= 1.2.2, < 3.0) + websocket (~> 1.0) sentry-raven (3.1.2) faraday (>= 1.0) simplecov (0.21.2) @@ -390,9 +404,16 @@ GEM unicode-display_width (2.4.2) unicode_utils (1.4.0) uniform_notifier (1.16.0) + webdrivers (5.3.1) + nokogiri (~> 1.6) + rubyzip (>= 1.3.0) + selenium-webdriver (~> 4.0, < 4.11) + websocket (1.2.10) websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) + xpath (3.2.0) + nokogiri (~> 1.8) zeitwerk (2.6.7) PLATFORMS @@ -407,6 +428,7 @@ DEPENDENCIES brakeman bullet byebug + capybara carrierwave config countries @@ -434,12 +456,12 @@ DEPENDENCIES psych (~> 3.3, >= 3.3.4) puma rack - rails (= 7.0.4.2) + rails (= 7.0.5) rails-erd rails-i18n rb-readline rest-client - rspec-rails (~> 4.0.2) + rspec-rails rubocop rubocop-rails seed-fu @@ -449,6 +471,7 @@ DEPENDENCIES spring-watcher-listen (~> 2.0.0) sprockets-rails tzinfo-data + webdrivers (~> 5.3, >= 5.3.1) BUNDLED WITH 2.4.6 diff --git a/config/initializers/keycloak.rb b/config/initializers/keycloak.rb index d4c7a60c0..9a463666b 100644 --- a/config/initializers/keycloak.rb +++ b/config/initializers/keycloak.rb @@ -2,10 +2,6 @@ Keycloak.configure do |config| - def frontend_tests? - Rails.env.test? && ENV['FRONTEND_TESTS'].present? - end - config.server_url = ENV['RAILS_KEYCLOAK_SERVER_URL'] config.realm_id = ENV['RAILS_KEYCLOAK_REALM_ID'] config.logger = Rails.logger @@ -13,7 +9,7 @@ def frontend_tests? config.skip_paths = { get: [/^\/assets\/.+/, /^\/styles\/.+/, /^\/healthz/, /^\/api\/env_settings/, /^\/status\/(.*)/, /^\/img\/.+/] } - if frontend_tests? || Rails.env.development? || Rails.application.keycloak_disabled? + if Rails.env.test? || Rails.env.development? || Rails.application.keycloak_disabled? test_skips = { get: [/^.+/], post: [/^.+/], diff --git a/spec/views/people/index_spec.rb b/spec/views/people/index_spec.rb new file mode 100644 index 000000000..a7784aba1 --- /dev/null +++ b/spec/views/people/index_spec.rb @@ -0,0 +1,8 @@ +require 'rails_helper' + +describe 'Check if people are listed', type: :system do + it 'shows the people links' do + visit people_path + expect(page).to have_css('h1 a[href^="/people/"]', minimum: 2) + end +end \ No newline at end of file