Compare commits
9 Commits
9ba5ac58d5
...
ffc7fa3801
Author | SHA1 | Date | |
---|---|---|---|
ffc7fa3801 | |||
91ebb9afee | |||
9035df5178 | |||
60a7b1342f | |||
![]() |
d04f7211e7 | ||
61cfdd2424 | |||
9856974684 | |||
c23ecfbbad | |||
![]() |
c70c0c5f60 |
4
.github/workflows/license_finder.yml
vendored
4
.github/workflows/license_finder.yml
vendored
@ -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
|
||||||
|
2
Gemfile
2
Gemfile
@ -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
|
||||||
|
20
Gemfile.lock
20
Gemfile.lock
@ -138,6 +138,14 @@ 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.23.1)
|
loofah (2.23.1)
|
||||||
crass (~> 1.0.2)
|
crass (~> 1.0.2)
|
||||||
@ -245,6 +253,7 @@ GEM
|
|||||||
regexp_parser (2.9.2)
|
regexp_parser (2.9.2)
|
||||||
reline (0.5.11)
|
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)
|
||||||
@ -277,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,6 +310,7 @@ GEM
|
|||||||
thor (1.3.2)
|
thor (1.3.2)
|
||||||
tilt (2.4.0)
|
tilt (2.4.0)
|
||||||
timeout (0.4.2)
|
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)
|
||||||
@ -314,6 +327,9 @@ GEM
|
|||||||
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
|
||||||
@ -334,6 +350,7 @@ DEPENDENCIES
|
|||||||
importmap-rails
|
importmap-rails
|
||||||
jbuilder
|
jbuilder
|
||||||
jsonapi-rails
|
jsonapi-rails
|
||||||
|
license_finder
|
||||||
money
|
money
|
||||||
pg (~> 1.1)
|
pg (~> 1.1)
|
||||||
pry
|
pry
|
||||||
@ -345,6 +362,7 @@ DEPENDENCIES
|
|||||||
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
|
||||||
|
@ -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,
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user