Compare commits

...

9 Commits

Author SHA1 Message Date
ffc7fa3801 Update dependency rails to v8
All checks were successful
Add copyright notice / copyright_notice (pull_request) Successful in 1m54s
Check usage of free licenses / build-static-assets (pull_request) Successful in 1m55s
Run unit tests / unit_tests (pull_request) Successful in 1m30s
2024-11-09 17:51:12 +01:00
91ebb9afee Merge pull request 'Install shoulda matchers, improve guests specs and change enum syntax' (#104) from deprecation-warning-rails-8 into main
Some checks failed
Check usage of free licenses / build-static-assets (push) Successful in 47s
Run unit tests / unit_tests (push) Successful in 2m10s
Build Nginx-based docker image / build-static-assets (push) Failing after 3m27s
Reviewed-on: #104
2024-11-09 16:48:32 +00:00
9035df5178 Install shoulda matchers, improve guests specs and change enum syntax
All checks were successful
Add copyright notice / copyright_notice (pull_request) Successful in 1m18s
Check usage of free licenses / build-static-assets (pull_request) Successful in 1m28s
Run unit tests / unit_tests (pull_request) Successful in 1m0s
2024-11-09 17:45:23 +01:00
60a7b1342f Add license finder as a development dependency
Some checks failed
Add copyright notice / copyright_notice (pull_request) Successful in 1m0s
Check usage of free licenses / build-static-assets (pull_request) Successful in 1m28s
Run unit tests / unit_tests (pull_request) Successful in 2m11s
Check usage of free licenses / build-static-assets (push) Successful in 45s
Run unit tests / unit_tests (push) Successful in 2m33s
Build Nginx-based docker image / build-static-assets (push) Failing after 20s
2024-11-09 08:52:40 +01:00
Renovate Bot
d04f7211e7 Update dependency solid_queue to v1.0.1
Some checks failed
Check usage of free licenses / build-static-assets (pull_request) Failing after 2m53s
Add copyright notice / copyright_notice (pull_request) Successful in 3m17s
Run unit tests / unit_tests (pull_request) Successful in 3m45s
2024-11-09 07:44:14 +00:00
61cfdd2424 Merge pull request 'Install project dependencies before running license finder' (#102) from fix-license-finder-action into main
Some checks failed
Check usage of free licenses / build-static-assets (push) Successful in 3m57s
Build Nginx-based docker image / build-static-assets (push) Failing after 7m34s
Run unit tests / unit_tests (push) Successful in 5m6s
Reviewed-on: #102
2024-11-09 07:43:41 +00:00
9856974684 Install project dependencies before running license finder
All checks were successful
Check usage of free licenses / build-static-assets (pull_request) Successful in 2m21s
Add copyright notice / copyright_notice (pull_request) Successful in 5m15s
Run unit tests / unit_tests (pull_request) Successful in 6m57s
2024-11-09 08:35:57 +01:00
c23ecfbbad Merge pull request 'Update dependency factory_bot_rails to v6.4.4' (#100) from renovate/factory_bot_rails-6.x-lockfile into main
Some checks failed
Check usage of free licenses / build-static-assets (push) Successful in 1m46s
Run unit tests / unit_tests (push) Successful in 5m1s
Build Nginx-based docker image / build-static-assets (push) Has been cancelled
Reviewed-on: #100
2024-11-09 07:30:46 +00:00
Renovate Bot
c70c0c5f60 Update dependency factory_bot_rails to v6.4.4
Some checks failed
renovate/artifacts Artifact file update failure
Check usage of free licenses / build-static-assets (pull_request) Successful in 3m6s
Add copyright notice / copyright_notice (pull_request) Successful in 7m45s
Run unit tests / unit_tests (pull_request) Successful in 10m41s
2024-11-09 01:07:47 +00:00
6 changed files with 130 additions and 72 deletions

View File

@ -17,7 +17,7 @@ jobs:
- uses: ruby/setup-ruby@v1 - uses: ruby/setup-ruby@v1
with: with:
ruby-version: '3.3' ruby-version: '3.3'
- name: Install license finder gem - name: Install project dependencies
run: gem install license_finder run: bundle install --jobs `getconf _NPROCESSORS_ONLN`
- name: Run license finder - name: Run license finder
run: license_finder run: license_finder

View File

@ -8,7 +8,7 @@ gem 'jbuilder'
gem 'money' gem 'money'
gem 'pg', '~> 1.1' gem 'pg', '~> 1.1'
gem 'puma', '>= 5.0' gem 'puma', '>= 5.0'
gem 'rails', '~> 7.2.0', '>= 7.2.1' gem 'rails', '~> 8.0.0', '>= 8.0.0'
gem 'redis', '>= 4.0.1' gem 'redis', '>= 4.0.1'
gem 'sprockets-rails' gem 'sprockets-rails'
gem 'stimulus-rails' gem 'stimulus-rails'
@ -24,8 +24,10 @@ gem 'rubytree'
group :development, :test do group :development, :test do
gem 'debug', platforms: %i[mri windows] gem 'debug', platforms: %i[mri windows]
gem 'factory_bot_rails' gem 'factory_bot_rails'
gem 'license_finder'
gem 'pry' gem 'pry'
gem 'rspec-rails', '~> 7.0.0' gem 'rspec-rails', '~> 7.0.0'
gem 'shoulda-matchers', '~> 6.0'
end end
group :development do group :development do

View File

@ -1,66 +1,65 @@
GEM GEM
remote: https://rubygems.org/ remote: https://rubygems.org/
specs: specs:
actioncable (7.2.2) actioncable (8.0.0)
actionpack (= 7.2.2) actionpack (= 8.0.0)
activesupport (= 7.2.2) activesupport (= 8.0.0)
nio4r (~> 2.0) nio4r (~> 2.0)
websocket-driver (>= 0.6.1) websocket-driver (>= 0.6.1)
zeitwerk (~> 2.6) zeitwerk (~> 2.6)
actionmailbox (7.2.2) actionmailbox (8.0.0)
actionpack (= 7.2.2) actionpack (= 8.0.0)
activejob (= 7.2.2) activejob (= 8.0.0)
activerecord (= 7.2.2) activerecord (= 8.0.0)
activestorage (= 7.2.2) activestorage (= 8.0.0)
activesupport (= 7.2.2) activesupport (= 8.0.0)
mail (>= 2.8.0) mail (>= 2.8.0)
actionmailer (7.2.2) actionmailer (8.0.0)
actionpack (= 7.2.2) actionpack (= 8.0.0)
actionview (= 7.2.2) actionview (= 8.0.0)
activejob (= 7.2.2) activejob (= 8.0.0)
activesupport (= 7.2.2) activesupport (= 8.0.0)
mail (>= 2.8.0) mail (>= 2.8.0)
rails-dom-testing (~> 2.2) rails-dom-testing (~> 2.2)
actionpack (7.2.2) actionpack (8.0.0)
actionview (= 7.2.2) actionview (= 8.0.0)
activesupport (= 7.2.2) activesupport (= 8.0.0)
nokogiri (>= 1.8.5) nokogiri (>= 1.8.5)
racc rack (>= 2.2.4)
rack (>= 2.2.4, < 3.2)
rack-session (>= 1.0.1) rack-session (>= 1.0.1)
rack-test (>= 0.6.3) rack-test (>= 0.6.3)
rails-dom-testing (~> 2.2) rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6) rails-html-sanitizer (~> 1.6)
useragent (~> 0.16) useragent (~> 0.16)
actiontext (7.2.2) actiontext (8.0.0)
actionpack (= 7.2.2) actionpack (= 8.0.0)
activerecord (= 7.2.2) activerecord (= 8.0.0)
activestorage (= 7.2.2) activestorage (= 8.0.0)
activesupport (= 7.2.2) activesupport (= 8.0.0)
globalid (>= 0.6.0) globalid (>= 0.6.0)
nokogiri (>= 1.8.5) nokogiri (>= 1.8.5)
actionview (7.2.2) actionview (8.0.0)
activesupport (= 7.2.2) activesupport (= 8.0.0)
builder (~> 3.1) builder (~> 3.1)
erubi (~> 1.11) erubi (~> 1.11)
rails-dom-testing (~> 2.2) rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6) rails-html-sanitizer (~> 1.6)
activejob (7.2.2) activejob (8.0.0)
activesupport (= 7.2.2) activesupport (= 8.0.0)
globalid (>= 0.3.6) globalid (>= 0.3.6)
activemodel (7.2.2) activemodel (8.0.0)
activesupport (= 7.2.2) activesupport (= 8.0.0)
activerecord (7.2.2) activerecord (8.0.0)
activemodel (= 7.2.2) activemodel (= 8.0.0)
activesupport (= 7.2.2) activesupport (= 8.0.0)
timeout (>= 0.4.0) timeout (>= 0.4.0)
activestorage (7.2.2) activestorage (8.0.0)
actionpack (= 7.2.2) actionpack (= 8.0.0)
activejob (= 7.2.2) activejob (= 8.0.0)
activerecord (= 7.2.2) activerecord (= 8.0.0)
activesupport (= 7.2.2) activesupport (= 8.0.0)
marcel (~> 1.0) marcel (~> 1.0)
activesupport (7.2.2) activesupport (8.0.0)
base64 base64
benchmark (>= 0.3) benchmark (>= 0.3)
bigdecimal bigdecimal
@ -72,13 +71,14 @@ GEM
minitest (>= 5.1) minitest (>= 5.1)
securerandom (>= 0.3) securerandom (>= 0.3)
tzinfo (~> 2.0, >= 2.0.5) tzinfo (~> 2.0, >= 2.0.5)
uri (>= 0.13.1)
ast (2.4.2) ast (2.4.2)
babel-source (5.8.35) babel-source (5.8.35)
babel-transpiler (0.7.0) babel-transpiler (0.7.0)
babel-source (>= 4.0, < 6) babel-source (>= 4.0, < 6)
execjs (~> 2.0) execjs (~> 2.0)
base64 (0.2.0) base64 (0.2.0)
benchmark (0.3.0) benchmark (0.4.0)
bigdecimal (3.1.8) bigdecimal (3.1.8)
bindex (0.8.1) bindex (0.8.1)
bootsnap (1.18.4) bootsnap (1.18.4)
@ -90,7 +90,7 @@ GEM
connection_pool (2.4.1) connection_pool (2.4.1)
crass (1.0.6) crass (1.0.6)
csv (3.3.0) csv (3.3.0)
date (3.3.4) date (3.4.0)
debug (1.9.2) debug (1.9.2)
irb (~> 1.10) irb (~> 1.10)
reline (>= 0.3.8) reline (>= 0.3.8)
@ -138,8 +138,16 @@ GEM
jsonapi-serializable (0.3.1) jsonapi-serializable (0.3.1)
jsonapi-renderer (~> 0.2.0) jsonapi-renderer (~> 0.2.0)
language_server-protocol (3.17.0.3) language_server-protocol (3.17.0.3)
license_finder (7.2.1)
bundler
csv (~> 3.2)
rubyzip (>= 1, < 3)
thor (~> 1.2)
tomlrb (>= 1.3, < 2.1)
with_env (= 1.1.0)
xml-simple (~> 1.1.9)
logger (1.6.1) logger (1.6.1)
loofah (2.22.0) loofah (2.23.1)
crass (~> 1.0.2) crass (~> 1.0.2)
nokogiri (>= 1.12.0) nokogiri (>= 1.12.0)
mail (2.8.1) mail (2.8.1)
@ -154,7 +162,7 @@ GEM
money (6.19.0) money (6.19.0)
i18n (>= 0.6.4, <= 2) i18n (>= 0.6.4, <= 2)
msgpack (1.7.2) msgpack (1.7.2)
net-imap (0.4.17) net-imap (0.5.1)
date date
net-protocol net-protocol
net-pop (0.1.2) net-pop (0.1.2)
@ -184,7 +192,7 @@ GEM
pry (0.14.2) pry (0.14.2)
coderay (~> 1.1) coderay (~> 1.1)
method_source (~> 1.0) method_source (~> 1.0)
psych (5.1.2) psych (5.2.0)
stringio stringio
puma (6.4.3) puma (6.4.3)
nio4r (~> 2.0) nio4r (~> 2.0)
@ -197,23 +205,22 @@ GEM
rack (>= 3.0.0) rack (>= 3.0.0)
rack-test (2.1.0) rack-test (2.1.0)
rack (>= 1.3) rack (>= 1.3)
rackup (2.1.0) rackup (2.2.0)
rack (>= 3) rack (>= 3)
webrick (~> 1.8) rails (8.0.0)
rails (7.2.2) actioncable (= 8.0.0)
actioncable (= 7.2.2) actionmailbox (= 8.0.0)
actionmailbox (= 7.2.2) actionmailer (= 8.0.0)
actionmailer (= 7.2.2) actionpack (= 8.0.0)
actionpack (= 7.2.2) actiontext (= 8.0.0)
actiontext (= 7.2.2) actionview (= 8.0.0)
actionview (= 7.2.2) activejob (= 8.0.0)
activejob (= 7.2.2) activemodel (= 8.0.0)
activemodel (= 7.2.2) activerecord (= 8.0.0)
activerecord (= 7.2.2) activestorage (= 8.0.0)
activestorage (= 7.2.2) activesupport (= 8.0.0)
activesupport (= 7.2.2)
bundler (>= 1.15.0) bundler (>= 1.15.0)
railties (= 7.2.2) railties (= 8.0.0)
rails-dom-testing (2.2.0) rails-dom-testing (2.2.0)
activesupport (>= 5.0.0) activesupport (>= 5.0.0)
minitest minitest
@ -221,9 +228,9 @@ GEM
rails-html-sanitizer (1.6.0) rails-html-sanitizer (1.6.0)
loofah (~> 2.21) loofah (~> 2.21)
nokogiri (~> 1.14) nokogiri (~> 1.14)
railties (7.2.2) railties (8.0.0)
actionpack (= 7.2.2) actionpack (= 8.0.0)
activesupport (= 7.2.2) activesupport (= 8.0.0)
irb (~> 1.13) irb (~> 1.13)
rackup (>= 1.0.0) rackup (>= 1.0.0)
rake (>= 12.2) rake (>= 12.2)
@ -244,8 +251,9 @@ GEM
redis-client (0.22.2) redis-client (0.22.2)
connection_pool connection_pool
regexp_parser (2.9.2) regexp_parser (2.9.2)
reline (0.5.10) reline (0.5.11)
io-console (~> 0.5) io-console (~> 0.5)
rexml (3.3.9)
rspec-core (3.13.2) rspec-core (3.13.2)
rspec-support (~> 3.13.0) rspec-support (~> 3.13.0)
rspec-expectations (3.13.3) rspec-expectations (3.13.3)
@ -278,8 +286,11 @@ GEM
ruby-progressbar (1.13.0) ruby-progressbar (1.13.0)
rubytree (2.1.0) rubytree (2.1.0)
json (~> 2.0, > 2.3.1) json (~> 2.0, > 2.3.1)
rubyzip (2.3.2)
securerandom (0.3.1) securerandom (0.3.1)
solid_queue (1.0.0) shoulda-matchers (6.4.0)
activesupport (>= 5.2.0)
solid_queue (1.0.1)
activejob (>= 7.1) activejob (>= 7.1)
activerecord (>= 7.1) activerecord (>= 7.1)
concurrent-ruby (>= 1.3.1) concurrent-ruby (>= 1.3.1)
@ -298,23 +309,27 @@ GEM
stringio (3.1.2) stringio (3.1.2)
thor (1.3.2) thor (1.3.2)
tilt (2.4.0) tilt (2.4.0)
timeout (0.4.1) timeout (0.4.2)
tomlrb (2.0.3)
turbo-rails (2.0.11) turbo-rails (2.0.11)
actionpack (>= 6.0.0) actionpack (>= 6.0.0)
railties (>= 6.0.0) railties (>= 6.0.0)
tzinfo (2.0.6) tzinfo (2.0.6)
concurrent-ruby (~> 1.0) concurrent-ruby (~> 1.0)
unicode-display_width (2.6.0) unicode-display_width (2.6.0)
uri (1.0.1)
useragent (0.16.10) useragent (0.16.10)
web-console (4.2.1) web-console (4.2.1)
actionview (>= 6.0.0) actionview (>= 6.0.0)
activemodel (>= 6.0.0) activemodel (>= 6.0.0)
bindex (>= 0.4.0) bindex (>= 0.4.0)
railties (>= 6.0.0) railties (>= 6.0.0)
webrick (1.8.2)
websocket-driver (0.7.6) websocket-driver (0.7.6)
websocket-extensions (>= 0.1.0) websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5) websocket-extensions (0.1.5)
with_env (1.1.0)
xml-simple (1.1.9)
rexml
zeitwerk (2.7.1) zeitwerk (2.7.1)
PLATFORMS PLATFORMS
@ -335,17 +350,19 @@ DEPENDENCIES
importmap-rails importmap-rails
jbuilder jbuilder
jsonapi-rails jsonapi-rails
license_finder
money money
pg (~> 1.1) pg (~> 1.1)
pry pry
puma (>= 5.0) puma (>= 5.0)
rack-cors rack-cors
rails (~> 7.2.0, >= 7.2.1) rails (~> 8.0.0, >= 8.0.0)
react-rails react-rails
redis (>= 4.0.1) redis (>= 4.0.1)
rspec-rails (~> 7.0.0) rspec-rails (~> 7.0.0)
rubocop rubocop
rubytree rubytree
shoulda-matchers (~> 6.0)
solid_queue (~> 1.0) solid_queue (~> 1.0)
sprockets-rails sprockets-rails
stimulus-rails stimulus-rails

View File

@ -3,7 +3,7 @@
class Guest < ApplicationRecord class Guest < ApplicationRecord
belongs_to :group belongs_to :group
enum status: { enum :status, {
considered: 0, considered: 0,
invited: 10, invited: 10,
confirmed: 20, confirmed: 20,

View File

@ -3,5 +3,37 @@
require 'rails_helper' require 'rails_helper'
RSpec.describe Guest, type: :model do RSpec.describe Guest, type: :model do
pending "add some examples to (or delete) #{__FILE__}" it do
should define_enum_for(:status).with_values(
considered: 0,
invited: 10,
confirmed: 20,
declined: 30,
tentative: 40
)
end
it { should belong_to(:group) }
describe 'scopes' do
describe '.potential' do
it 'returns guests that are not declined or considered' do
_declined_guest = create(:guest, status: :declined)
_considered_guest = create(:guest, status: :considered)
invited_guest = create(:guest, status: :invited)
confirmed_guest = create(:guest, status: :confirmed)
tentative_guest = create(:guest, status: :tentative)
expect(Guest.potential).to match_array([invited_guest, confirmed_guest, tentative_guest])
end
end
end
describe '#full_name' do
it 'returns the full name of the guest' do
guest = create(:guest, first_name: 'John', last_name: 'Doe')
expect(guest.full_name).to eq('John Doe')
end
end
end end

View File

@ -66,3 +66,10 @@ RSpec.configure do |config|
# config.filter_gems_from_backtrace("gem name") # config.filter_gems_from_backtrace("gem name")
config.include FactoryBot::Syntax::Methods config.include FactoryBot::Syntax::Methods
end end
Shoulda::Matchers.configure do |config|
config.integrate do |with|
with.test_framework :rspec
with.library :rails
end
end