Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI
name: Tests

on: [push, pull_request]

Expand Down Expand Up @@ -62,3 +62,5 @@ jobs:
run: yarn install --frozen-lockfile --non-interactive
- name: Run tests
run: bundle exec rails test
- name: Run system tests
run: bundle exec rails test:system
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,12 @@ group :development do
end

group :test do
gem 'capybara'
gem 'committee'
gem 'minitest'
gem 'minitest-reporters'
gem 'rails-controller-testing'
gem 'selenium-webdriver'
gem 'vcr'
gem 'webmock'
end
Expand Down
30 changes: 25 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ GEM
activerecord (>= 4.0)
autoprefixer-rails (10.4.13.0)
execjs (~> 2)
base64 (0.1.2)
base64 (0.3.0)
bcp47_spec (0.2.1)
bcrypt (3.1.22)
benchmark (0.5.0)
Expand All @@ -135,6 +135,15 @@ GEM
railties (>= 3.1)
builder (3.3.0)
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)
case_transform (0.2)
activesupport
cgi (0.5.1)
Expand Down Expand Up @@ -425,7 +434,7 @@ GEM
orm_adapter (0.5.0)
ostruct (0.6.3)
parallel (1.23.0)
parser (3.2.2.3)
parser (3.3.11.1)
ast (~> 2.4.1)
racc
pg (1.5.6)
Expand Down Expand Up @@ -624,12 +633,11 @@ GEM
faraday (>= 0.9, < 3, != 2.0.0)
rss (0.3.0)
rexml
rubocop (1.56.1)
base64 (~> 0.1.1)
rubocop (1.57.2)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.2.2.3)
parser (>= 3.2.2.4)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
Expand All @@ -643,6 +651,7 @@ GEM
faraday (>= 1)
faraday-multipart (>= 1)
ruby-progressbar (1.13.0)
rubyzip (3.3.0)
safely_block (0.4.0)
sass (3.7.4)
sass-listen (~> 4.0.0)
Expand All @@ -661,6 +670,12 @@ GEM
tilt
scanf (1.0.0)
securerandom (0.4.1)
selenium-webdriver (4.44.0)
base64 (~> 0.2)
logger (~> 1.4)
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2, < 4.0)
websocket (~> 1.0)
sentry-rails (5.11.0)
railties (>= 5.0)
sentry-ruby (~> 5.11.0)
Expand Down Expand Up @@ -803,13 +818,16 @@ GEM
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
webrick (1.9.2)
websocket (1.2.11)
websocket-driver (0.8.0)
base64
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
whenever (1.0.0)
chronic (>= 0.6.3)
will_paginate (4.0.0)
xpath (3.2.0)
nokogiri (~> 1.8)
yaml-ld (0.0.3)
json-ld (~> 3.3)
psych (>= 3.3)
Expand All @@ -833,6 +851,7 @@ DEPENDENCIES
bootstrap-sass
bootstrap-tab-history-rails
byebug
capybara
committee
country_select
devise
Expand Down Expand Up @@ -883,6 +902,7 @@ DEPENDENCIES
ruby-openai
sass-rails
sassc-rails
selenium-webdriver
sentry-rails
sentry-ruby
sentry-sidekiq
Expand Down
8 changes: 8 additions & 0 deletions test/application_system_test_case.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
require 'test_helper'

class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
driven_by :selenium, using: :headless_chrome, screen_size: [1400, 1400] do |options|
options.add_argument('--no-sandbox')
options.add_argument('--disable-dev-shm-usage')
end
end
26 changes: 26 additions & 0 deletions test/system/events_calendar_system_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
require 'application_system_test_case'

class EventsCalendarSystemTest < ApplicationSystemTestCase
test 'calendar tab loads and renders events with javascript' do
freeze_time(Time.utc(2026, 5, 20, 12, 0, 0)) do
Event.create!(
title: 'System calendar event',
url: 'http://example.com/system-calendar-event',
user: users(:regular_user),
content_provider: content_providers(:goblet),
timezone: 'UTC',
start: Time.now.beginning_of_month + 10.days,
end: Time.now.beginning_of_month + 10.days + 2.hours,
city: 'Manchester',
country: 'United Kingdom'
)

visit events_path

within('.index-display-options') { click_link 'Calendar' }

assert_selector('#events_calendar #calendar.simple-calendar')
assert_selector('#events_calendar a.clear-both', text: 'System calendar event')
end
end
end
1 change: 1 addition & 0 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
VCR.configure do |config|
config.cassette_library_dir = 'test/vcr_cassettes'
config.hook_into :webmock
config.ignore_localhost = true
# config.allow_http_connections_when_no_cassette = true
end

Expand Down
Loading