Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EL-1781 Rails update to 7.2.1 #1604

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
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: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby "3.3.4"

# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
gem "rails", "~> 7.1.3"
gem "rails", "~> 7.2.1"

# The modern asset pipeline for Rails [https://github.com/rails/propshaft]
gem "propshaft", ">= 0.9.0"
Expand Down Expand Up @@ -102,7 +102,7 @@ group :test do
gem "webmock", require: false
gem "axe-core-rspec"
gem "rack_session_access"
gem "database_cleaner"
gem "database_cleaner-active_record"
gem "vcr", require: false
end

Expand Down
139 changes: 67 additions & 72 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,84 +1,80 @@
GEM
remote: https://rubygems.org/
specs:
actioncable (7.1.3.4)
actionpack (= 7.1.3.4)
activesupport (= 7.1.3.4)
actioncable (7.2.1)
actionpack (= 7.2.1)
activesupport (= 7.2.1)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
zeitwerk (~> 2.6)
actionmailbox (7.1.3.4)
actionpack (= 7.1.3.4)
activejob (= 7.1.3.4)
activerecord (= 7.1.3.4)
activestorage (= 7.1.3.4)
activesupport (= 7.1.3.4)
mail (>= 2.7.1)
net-imap
net-pop
net-smtp
actionmailer (7.1.3.4)
actionpack (= 7.1.3.4)
actionview (= 7.1.3.4)
activejob (= 7.1.3.4)
activesupport (= 7.1.3.4)
mail (~> 2.5, >= 2.5.4)
net-imap
net-pop
net-smtp
actionmailbox (7.2.1)
actionpack (= 7.2.1)
activejob (= 7.2.1)
activerecord (= 7.2.1)
activestorage (= 7.2.1)
activesupport (= 7.2.1)
mail (>= 2.8.0)
actionmailer (7.2.1)
actionpack (= 7.2.1)
actionview (= 7.2.1)
activejob (= 7.2.1)
activesupport (= 7.2.1)
mail (>= 2.8.0)
rails-dom-testing (~> 2.2)
actionpack (7.1.3.4)
actionview (= 7.1.3.4)
activesupport (= 7.1.3.4)
actionpack (7.2.1)
actionview (= 7.2.1)
activesupport (= 7.2.1)
nokogiri (>= 1.8.5)
racc
rack (>= 2.2.4)
rack (>= 2.2.4, < 3.2)
rack-session (>= 1.0.1)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
actiontext (7.1.3.4)
actionpack (= 7.1.3.4)
activerecord (= 7.1.3.4)
activestorage (= 7.1.3.4)
activesupport (= 7.1.3.4)
useragent (~> 0.16)
actiontext (7.2.1)
actionpack (= 7.2.1)
activerecord (= 7.2.1)
activestorage (= 7.2.1)
activesupport (= 7.2.1)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (7.1.3.4)
activesupport (= 7.1.3.4)
actionview (7.2.1)
activesupport (= 7.2.1)
builder (~> 3.1)
erubi (~> 1.11)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
activejob (7.1.3.4)
activesupport (= 7.1.3.4)
activejob (7.2.1)
activesupport (= 7.2.1)
globalid (>= 0.3.6)
activemodel (7.1.3.4)
activesupport (= 7.1.3.4)
activemodel (7.2.1)
activesupport (= 7.2.1)
activemodel-serializers-xml (1.0.2)
activemodel (> 5.x)
activesupport (> 5.x)
builder (~> 3.1)
activerecord (7.1.3.4)
activemodel (= 7.1.3.4)
activesupport (= 7.1.3.4)
activerecord (7.2.1)
activemodel (= 7.2.1)
activesupport (= 7.2.1)
timeout (>= 0.4.0)
activestorage (7.1.3.4)
actionpack (= 7.1.3.4)
activejob (= 7.1.3.4)
activerecord (= 7.1.3.4)
activesupport (= 7.1.3.4)
activestorage (7.2.1)
actionpack (= 7.2.1)
activejob (= 7.2.1)
activerecord (= 7.2.1)
activesupport (= 7.2.1)
marcel (~> 1.0)
activesupport (7.1.3.4)
activesupport (7.2.1)
base64
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
concurrent-ruby (~> 1.0, >= 1.3.1)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
logger (>= 1.4.2)
minitest (>= 5.1)
mutex_m
tzinfo (~> 2.0)
securerandom (>= 0.3)
tzinfo (~> 2.0, >= 2.0.5)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
annotate_models (1.0.1)
Expand Down Expand Up @@ -138,9 +134,7 @@ GEM
cssbundling-rails (1.4.1)
railties (>= 6.0.0)
csv (3.3.0)
database_cleaner (2.0.2)
database_cleaner-active_record (>= 2, < 3)
database_cleaner-active_record (2.1.0)
database_cleaner-active_record (2.2.0)
activerecord (>= 5.a)
database_cleaner-core (~> 2.0.0)
database_cleaner-core (2.0.1)
Expand Down Expand Up @@ -259,7 +253,6 @@ GEM
msgpack (1.7.2)
multi_xml (0.7.1)
bigdecimal (~> 3.1)
mutex_m (0.2.0)
nested_form (0.3.2)
net-http (0.4.1)
uri
Expand Down Expand Up @@ -357,20 +350,20 @@ GEM
rackup (1.0.0)
rack (< 3)
webrick
rails (7.1.3.4)
actioncable (= 7.1.3.4)
actionmailbox (= 7.1.3.4)
actionmailer (= 7.1.3.4)
actionpack (= 7.1.3.4)
actiontext (= 7.1.3.4)
actionview (= 7.1.3.4)
activejob (= 7.1.3.4)
activemodel (= 7.1.3.4)
activerecord (= 7.1.3.4)
activestorage (= 7.1.3.4)
activesupport (= 7.1.3.4)
rails (7.2.1)
actioncable (= 7.2.1)
actionmailbox (= 7.2.1)
actionmailer (= 7.2.1)
actionpack (= 7.2.1)
actiontext (= 7.2.1)
actionview (= 7.2.1)
activejob (= 7.2.1)
activemodel (= 7.2.1)
activerecord (= 7.2.1)
activestorage (= 7.2.1)
activesupport (= 7.2.1)
bundler (>= 1.15.0)
railties (= 7.1.3.4)
railties (= 7.2.1)
rails-dom-testing (2.2.0)
activesupport (>= 5.0.0)
minitest
Expand All @@ -385,10 +378,10 @@ GEM
nested_form (~> 0.3)
rails (>= 6.0, < 8)
turbo-rails (>= 1.0, < 3)
railties (7.1.3.4)
actionpack (= 7.1.3.4)
activesupport (= 7.1.3.4)
irb
railties (7.2.1)
actionpack (= 7.2.1)
activesupport (= 7.2.1)
irb (~> 1.13)
rackup (>= 1.0.0)
rake (>= 12.2)
thor (~> 1.0, >= 1.2.2)
Expand Down Expand Up @@ -485,6 +478,7 @@ GEM
rexml
rubyzip (2.3.2)
safe_shell (1.1.0)
securerandom (0.3.1)
selenium-webdriver (4.25.0)
base64 (~> 0.2)
logger (~> 1.4)
Expand Down Expand Up @@ -532,6 +526,7 @@ GEM
concurrent-ruby (~> 1.0)
unicode-display_width (2.6.0)
uri (0.13.1)
useragent (0.16.10)
vcr (6.3.1)
base64
version_gem (1.1.4)
Expand Down Expand Up @@ -580,7 +575,7 @@ DEPENDENCIES
capybara
capybara-selenium
cssbundling-rails
database_cleaner
database_cleaner-active_record
debug
devise
dotenv-rails (>= 3.1.1)
Expand Down Expand Up @@ -609,7 +604,7 @@ DEPENDENCIES
pry-stack_explorer
puma (~> 6.4)
rack_session_access
rails (~> 7.1.3)
rails (~> 7.2.1)
rails_admin
redis-rails
rexml (>= 3.3.4)
Expand Down
3 changes: 2 additions & 1 deletion app/forms/additional_property_details_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ class AdditionalPropertyDetailsForm
ITEMS_SESSION_KEY = "additional_properties".freeze
ITEM_MODEL = AdditionalPropertyModel
ATTRIBUTES = %i[additional_properties].freeze
alias_attribute :additional_properties, :items
alias_method :additional_properties, :items
alias_method :additional_properties=, :items=

class << self
def add_extra_attributes_to_model_from_session(model, session_data, index)
Expand Down
3 changes: 2 additions & 1 deletion app/forms/benefit_details_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ class BenefitDetailsForm
ITEMS_SESSION_KEY = "benefits".freeze
ITEM_MODEL = BenefitModel
ATTRIBUTES = %i[benefits].freeze
alias_attribute :benefits, :items
alias_method :benefits, :items
alias_method :benefits=, :items=

def benefit_list
@benefit_list ||= begin
Expand Down
3 changes: 2 additions & 1 deletion app/forms/client_assets_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ class ClientAssetsForm < AssetsForm

ITEMS_SESSION_KEY = "bank_accounts".freeze
ITEM_MODEL = BankAccountModel
alias_attribute :bank_accounts, :items
alias_method :bank_accounts, :items
alias_method :bank_accounts=, :items=

class << self
def add_extra_attributes_to_model_from_session(bank_account_model, session_data, _)
Expand Down
3 changes: 2 additions & 1 deletion app/forms/dependant_income_details_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ class DependantIncomeDetailsForm
ITEMS_SESSION_KEY = "dependant_incomes".freeze
ITEM_MODEL = DependantIncomeModel
ATTRIBUTES = %i[dependant_incomes].freeze
alias_attribute :dependant_incomes, :items
alias_method :dependant_incomes, :items
alias_method :dependant_incomes=, :items=

def max_items
(check.adult_dependants ? check.adult_dependants_count : 0) + (check.child_dependants ? check.child_dependants_count : 0)
Expand Down
3 changes: 2 additions & 1 deletion app/forms/income_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ class IncomeForm
ITEMS_SESSION_KEY = "incomes".freeze
ITEM_MODEL = IncomeModel
ATTRIBUTES = %i[incomes].freeze
alias_attribute :incomes, :items
alias_method :incomes, :items
alias_method :incomes=, :items=

def self.add_extra_attributes_to_model_from_session(model, session_data, _)
model.controlled = Steps::Logic.controlled?(session_data)
Expand Down
3 changes: 2 additions & 1 deletion app/forms/partner_assets_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ class PartnerAssetsForm < AssetsForm

ITEMS_SESSION_KEY = "partner_bank_accounts".freeze
ITEM_MODEL = BankAccountModel
alias_attribute :bank_accounts, :items
alias_method :bank_accounts, :items
alias_method :bank_accounts=, :items=
end
3 changes: 2 additions & 1 deletion app/forms/vehicles_details_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ class VehiclesDetailsForm
ITEMS_SESSION_KEY = "vehicles".freeze
ITEM_MODEL = VehicleModel
ATTRIBUTES = %i[vehicles].freeze
alias_attribute :vehicles, :items
alias_method :vehicles, :items
alias_method :vehicles=, :items=

class << self
def add_extra_attributes_to_model_from_session(vehicle_model, session_data, _)
Expand Down
24 changes: 19 additions & 5 deletions spec/rails_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
require "rspec/rails"
require "axe-rspec"
require "pry-rescue/rspec" if Rails.env.development?
require "database_cleaner/active_record"

Capybara.register_driver :headless_chrome do |app|
options = Selenium::WebDriver::Chrome::Options.new
Expand Down Expand Up @@ -168,11 +169,24 @@
expect(ErrorService).not_to receive(:call) unless test.metadata.key?(:throws_cfe_error)
end

config.before(:suite) do
DatabaseCleaner.clean_with :truncation
end
config.after(:suite) do
DatabaseCleaner.clean_with :truncation
RSpec.configure do |test|
test.use_transactional_fixtures = false

# Clean the database before the suite runs
test.before(:suite) do
DatabaseCleaner.clean_with(:truncation)
end

# Use truncation before each test runs
test.before do
DatabaseCleaner.strategy = :truncation
DatabaseCleaner.start
end

# Clean the database after each test
test.after do
DatabaseCleaner.clean
end
end

config.after(:suite) do
Expand Down