Skip to content

Commit

Permalink
add gems, update keycloak config and add sample test
Browse files Browse the repository at this point in the history
  • Loading branch information
kcinay055679 committed Feb 5, 2024
1 parent 5494691 commit 80322c2
Show file tree
Hide file tree
Showing 4 changed files with 92 additions and 63 deletions.
6 changes: 4 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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
Expand All @@ -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]
135 changes: 79 additions & 56 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand All @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand All @@ -407,6 +428,7 @@ DEPENDENCIES
brakeman
bullet
byebug
capybara
carrierwave
config
countries
Expand Down Expand Up @@ -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
Expand All @@ -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
6 changes: 1 addition & 5 deletions config/initializers/keycloak.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,14 @@

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
config.ca_certificate_file = "/etc/ssl/certs/ca-certificates.crt"
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: [/^.+/],
Expand Down
8 changes: 8 additions & 0 deletions spec/views/people/index_spec.rb
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 80322c2

Please sign in to comment.