From c3dd3ab87a651cae44418e17d6662a291e92217c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 13 Aug 2024 17:12:05 -0500 Subject: [PATCH] Upgrade to Rails 7.2.0 (#1632) Updates `@rails/actioncable` from 7.1.3 to 7.2.0 Updates `@rails/actiontext` from 7.1.3 to 7.2.0 Updates `@rails/activestorage` from 7.1.3 to 7.2.0 Updates `rails` gem from 7.1.3 to 7.2.0 --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Paul Hinze --- Gemfile | 2 +- Gemfile.lock | 141 +++++++++--------- app/models/adjustment.rb | 4 +- app/models/concerns/item_attributes.rb | 2 +- app/models/concerns/item_statuses.rb | 2 +- app/models/item_attachment.rb | 2 +- app/models/member.rb | 4 +- app/models/membership.rb | 2 +- app/models/renewal_request.rb | 2 +- app/models/stem.rb | 2 +- app/models/ticket.rb | 2 +- app/models/user.rb | 2 +- .../20200504134052_assign_member_numbers.rb | 2 +- .../20200906182546_add_pronouns_to_members.rb | 2 +- ...20202191706_create_enum_for_item_status.rb | 2 +- package.json | 4 +- .../admin/appointments_controller_test.rb | 4 +- .../application_controller_test.rb | 4 +- test/helpers/holds_helper_test.rb | 3 - test/lib/certificate/generator_test.rb | 4 +- test/lib/map/chicago_test.rb | 4 +- test/models/adjustment_test.rb | 12 +- test/models/hold_test.rb | 1 + test/models/loan_test.rb | 11 +- test/models/member_test.rb | 4 +- test/models/membership_test.rb | 4 +- test/models/notification_test.rb | 4 +- test/nulls/null_borrow_policy_test.rb | 2 +- test/nulls/null_item_test.rb | 4 +- test/system/admin/holds_test.rb | 4 +- test/system/admin/items_test.rb | 3 +- .../admin/reports/monthly_activities_test.rb | 77 +++++----- yarn.lock | 26 ++-- 33 files changed, 182 insertions(+), 166 deletions(-) diff --git a/Gemfile b/Gemfile index 0ff43791a..14eca1881 100644 --- a/Gemfile +++ b/Gemfile @@ -4,7 +4,7 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" } ruby "3.1.6" # Bundle edge Rails instead: gem "rails", github: "rails/rails" -gem "rails", "~> 7.1.3" +gem "rails", "~> 7.2.0" # Since Rails 7 sprockets is optional; we still use it so we need to depend on # the gem explicitly diff --git a/Gemfile.lock b/Gemfile.lock index 18485b963..5c0341fc1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -10,83 +10,79 @@ GIT GEM remote: https://rubygems.org/ specs: - actioncable (7.1.3.4) - actionpack (= 7.1.3.4) - activesupport (= 7.1.3.4) + actioncable (7.2.0) + actionpack (= 7.2.0) + activesupport (= 7.2.0) 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.0) + actionpack (= 7.2.0) + activejob (= 7.2.0) + activerecord (= 7.2.0) + activestorage (= 7.2.0) + activesupport (= 7.2.0) + mail (>= 2.8.0) + actionmailer (7.2.0) + actionpack (= 7.2.0) + actionview (= 7.2.0) + activejob (= 7.2.0) + activesupport (= 7.2.0) + 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.0) + actionview (= 7.2.0) + activesupport (= 7.2.0) 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.0) + actionpack (= 7.2.0) + activerecord (= 7.2.0) + activestorage (= 7.2.0) + activesupport (= 7.2.0) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.1.3.4) - activesupport (= 7.1.3.4) + actionview (7.2.0) + activesupport (= 7.2.0) 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.0) + activesupport (= 7.2.0) globalid (>= 0.3.6) - activemodel (7.1.3.4) - activesupport (= 7.1.3.4) - activerecord (7.1.3.4) - activemodel (= 7.1.3.4) - activesupport (= 7.1.3.4) + activemodel (7.2.0) + activesupport (= 7.2.0) + activerecord (7.2.0) + activemodel (= 7.2.0) + activesupport (= 7.2.0) timeout (>= 0.4.0) activerecord-postgres_enum (2.1.0) activerecord (>= 5.2) pg - 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.0) + actionpack (= 7.2.0) + activejob (= 7.2.0) + activerecord (= 7.2.0) + activesupport (= 7.2.0) marcel (~> 1.0) - activesupport (7.1.3.4) + activesupport (7.2.0) 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) acts_as_list (1.2.2) activerecord (>= 6.1) activesupport (>= 6.1) @@ -117,9 +113,9 @@ GEM appsignal (3.12.6) rack ast (2.4.2) - audited (5.6.0) - activerecord (>= 5.2, < 7.2) - activesupport (>= 5.2, < 7.2) + audited (5.4.1) + activerecord (>= 5.0, < 7.7) + activesupport (>= 5.0, < 7.7) aws-eventstream (1.3.0) aws-partitions (1.961.0) aws-sdk-core (3.201.3) @@ -353,12 +349,11 @@ GEM multi_json (1.15.0) multi_xml (0.6.0) multipart-post (2.4.1) - mutex_m (0.2.0) net-http (0.4.1) uri net-http-persistent (4.0.2) connection_pool (~> 2.2) - net-imap (0.4.11) + net-imap (0.4.14) date net-protocol net-pop (0.1.2) @@ -433,20 +428,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.0) + actioncable (= 7.2.0) + actionmailbox (= 7.2.0) + actionmailer (= 7.2.0) + actionpack (= 7.2.0) + actiontext (= 7.2.0) + actionview (= 7.2.0) + activejob (= 7.2.0) + activemodel (= 7.2.0) + activerecord (= 7.2.0) + activestorage (= 7.2.0) + activesupport (= 7.2.0) bundler (>= 1.15.0) - railties (= 7.1.3.4) + railties (= 7.2.0) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) actionview (>= 5.0.1.rc1) @@ -458,10 +453,10 @@ GEM rails-html-sanitizer (1.6.0) loofah (~> 2.21) nokogiri (~> 1.14) - railties (7.1.3.4) - actionpack (= 7.1.3.4) - activesupport (= 7.1.3.4) - irb + railties (7.2.0) + actionpack (= 7.2.0) + activesupport (= 7.2.0) + irb (~> 1.13) rackup (>= 1.0.0) rake (>= 12.2) thor (~> 1.0, >= 1.2.2) @@ -515,6 +510,7 @@ GEM scenic (1.8.0) activerecord (>= 4.0.0) railties (>= 4.0.0) + securerandom (0.3.1) signet (0.19.0) addressable (~> 2.8) faraday (>= 0.17.5, < 3.a) @@ -597,6 +593,7 @@ GEM concurrent-ruby (~> 1.0) unicode-display_width (2.5.0) uri (0.13.0) + useragent (0.16.10) version_gem (1.1.4) warden (1.2.9) rack (>= 2.0.9) @@ -663,7 +660,7 @@ DEPENDENCIES pg_search puma pundit - rails (~> 7.1.3) + rails (~> 7.2.0) rails-controller-testing reverse_markdown scenic diff --git a/app/models/adjustment.rb b/app/models/adjustment.rb index 87643f085..a42d184fc 100644 --- a/app/models/adjustment.rb +++ b/app/models/adjustment.rb @@ -1,13 +1,13 @@ class Adjustment < ApplicationRecord monetize :amount_cents - enum payment_source: { + enum :payment_source, { cash: "cash", square: "square", forgiveness: "forgiveness" } - enum kind: { + enum :kind, { fine: "fine", membership: "membership", donation: "donation", diff --git a/app/models/concerns/item_attributes.rb b/app/models/concerns/item_attributes.rb index 23a72fe2e..f5adbef80 100644 --- a/app/models/concerns/item_attributes.rb +++ b/app/models/concerns/item_attributes.rb @@ -11,7 +11,7 @@ module ItemAttributes has_rich_text :description - enum power_source: { + enum :power_source, { solar: "solar", gas: "gas", air: "air", diff --git a/app/models/concerns/item_statuses.rb b/app/models/concerns/item_statuses.rb index b72c83b3e..1ff3d00d3 100644 --- a/app/models/concerns/item_statuses.rb +++ b/app/models/concerns/item_statuses.rb @@ -20,7 +20,7 @@ module ItemStatuses } included do - enum status: { + enum :status, { pending: "pending", active: "active", maintenance: "maintenance", diff --git a/app/models/item_attachment.rb b/app/models/item_attachment.rb index bc244cae7..db33faacf 100644 --- a/app/models/item_attachment.rb +++ b/app/models/item_attachment.rb @@ -4,7 +4,7 @@ class ItemAttachment < ApplicationRecord has_one_attached :file - enum kind: { + enum :kind, { "manual" => "manual", "parts_list" => "parts_list", "other" => "other" diff --git a/app/models/member.rb b/app/models/member.rb index 50ef4cfd5..49270a140 100644 --- a/app/models/member.rb +++ b/app/models/member.rb @@ -22,8 +22,8 @@ class Member < ApplicationRecord has_many :notes, as: :notable PRONOUNS = ["he/him", "she/her", "they/them"] - enum id_kind: {drivers_license: 0, state_id: 1, city_key: 2, student_id: 3, employee_id: 4, other_id_kind: 5} - enum status: {pending: 0, verified: 1, suspended: 2, deactivated: 3}, _prefix: true + enum :id_kind, {drivers_license: 0, state_id: 1, city_key: 2, student_id: 3, employee_id: 4, other_id_kind: 5} + enum :status, {pending: 0, verified: 1, suspended: 2, deactivated: 3}, prefix: true validates :email, format: {with: URI::MailTo::EMAIL_REGEXP, message: "must be a valid email"}, diff --git a/app/models/membership.rb b/app/models/membership.rb index 7be5e27c2..a81edb8f0 100644 --- a/app/models/membership.rb +++ b/app/models/membership.rb @@ -1,7 +1,7 @@ class Membership < ApplicationRecord class PendingMembership < StandardError; end - enum membership_type: { + enum :membership_type, { initial: "initial", renewal: "renewal" } diff --git a/app/models/renewal_request.rb b/app/models/renewal_request.rb index 93e33373b..a070f20a7 100644 --- a/app/models/renewal_request.rb +++ b/app/models/renewal_request.rb @@ -1,7 +1,7 @@ class RenewalRequest < ApplicationRecord belongs_to :loan - enum status: { + enum :status, { requested: "requested", approved: "approved", rejected: "rejected" diff --git a/app/models/stem.rb b/app/models/stem.rb index fb4934011..c03cda087 100644 --- a/app/models/stem.rb +++ b/app/models/stem.rb @@ -6,7 +6,7 @@ module AnswerTypes ALL = [TEXT, INTEGER] end - enum answer_type: { + enum :answer_type, { AnswerTypes::INTEGER => AnswerTypes::INTEGER, AnswerTypes::TEXT => AnswerTypes::TEXT } diff --git a/app/models/ticket.rb b/app/models/ticket.rb index 09ff16911..a9b7fb3ed 100644 --- a/app/models/ticket.rb +++ b/app/models/ticket.rb @@ -13,7 +13,7 @@ class Ticket < ApplicationRecord "resolved" => "the problem has been fixed" } - enum status: { + enum :status, { assess: "assess", parts: "parts", repairing: "repairing", diff --git a/app/models/user.rb b/app/models/user.rb index 690d6df6f..b7fc26887 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -7,7 +7,7 @@ class User < ApplicationRecord # while the canonical list of roles is the "user_role" enum in the # database, this enum exists to help display the list of roles # elsewhere in the app - enum role: { + enum :role, { member: "member", staff: "staff", admin: "admin", diff --git a/db/migrate/20200504134052_assign_member_numbers.rb b/db/migrate/20200504134052_assign_member_numbers.rb index c4f232783..2219e6de5 100644 --- a/db/migrate/20200504134052_assign_member_numbers.rb +++ b/db/migrate/20200504134052_assign_member_numbers.rb @@ -1,6 +1,6 @@ class AssignMemberNumbers < ActiveRecord::Migration[6.0] class Member < ActiveRecord::Base - enum status: [:pending, :verified, :suspended, :deactivated], _prefix: true + enum :status, [:pending, :verified, :suspended, :deactivated], prefix: true scope :verified, -> { where(status: statuses[:verified]) } def assign_number self.number = (self.class.maximum(:number) || 0) + 1 diff --git a/db/migrate/20200906182546_add_pronouns_to_members.rb b/db/migrate/20200906182546_add_pronouns_to_members.rb index 454558c52..d518518f9 100644 --- a/db/migrate/20200906182546_add_pronouns_to_members.rb +++ b/db/migrate/20200906182546_add_pronouns_to_members.rb @@ -1,7 +1,7 @@ class AddPronounsToMembers < ActiveRecord::Migration[6.0] class TemporaryMember < ActiveRecord::Base self.table_name = "members" - enum pronoun: [:"he/him", :"she/her", :"they/them", :custom_pronoun] + enum :pronoun, [:"he/him", :"she/her", :"they/them", :custom_pronoun] end def change diff --git a/db/migrate/20220202191706_create_enum_for_item_status.rb b/db/migrate/20220202191706_create_enum_for_item_status.rb index 7e5c6ce82..1bd347f04 100644 --- a/db/migrate/20220202191706_create_enum_for_item_status.rb +++ b/db/migrate/20220202191706_create_enum_for_item_status.rb @@ -1,6 +1,6 @@ class CreateEnumForItemStatus < ActiveRecord::Migration[6.1] class Item < ActiveRecord::Base - enum status: [:pending, :active, :maintenance, :retired] + enum :status, [:pending, :active, :maintenance, :retired] end def change diff --git a/package.json b/package.json index 1e232c827..1bc378231 100644 --- a/package.json +++ b/package.json @@ -10,8 +10,8 @@ "@appsignal/stimulus": "^1.0.18", "@hotwired/stimulus": "^3.2.2", "@hotwired/turbo-rails": "^8.0.5", - "@rails/actioncable": "^7.1.3", - "@rails/actiontext": "^7.1.3", + "@rails/actioncable": "^7.2.0", + "@rails/actiontext": "^7.2.0", "@rails/activestorage": "^7.1.3", "@rails/ujs": "^7.1.3", "@selectize/selectize": "^0.15.2", diff --git a/test/controllers/admin/appointments_controller_test.rb b/test/controllers/admin/appointments_controller_test.rb index fa148620a..87718d6af 100644 --- a/test/controllers/admin/appointments_controller_test.rb +++ b/test/controllers/admin/appointments_controller_test.rb @@ -42,7 +42,9 @@ class AppointmentsControllerTest < ActionDispatch::IntegrationTest end test "renders show page with items to pickup and drop off" do - get admin_appointment_path(@appointment) + assert_nothing_raised do + get admin_appointment_path(@appointment) + end end end end diff --git a/test/controllers/application_controller_test.rb b/test/controllers/application_controller_test.rb index 040df31b2..e5a52a3d0 100644 --- a/test/controllers/application_controller_test.rb +++ b/test/controllers/application_controller_test.rb @@ -38,7 +38,9 @@ class ApplicationControllerTest < ActionDispatch::IntegrationTest end test "ignores a poorly formed referer" do - get new_user_session_path, headers: {referer: "not a valid referer"} + assert_nothing_raised do + get new_user_session_path, headers: {referer: "not a valid referer"} + end end end diff --git a/test/helpers/holds_helper_test.rb b/test/helpers/holds_helper_test.rb index ac8d2325e..8b346a4ff 100644 --- a/test/helpers/holds_helper_test.rb +++ b/test/helpers/holds_helper_test.rb @@ -24,7 +24,4 @@ class HoldsHelperTest < ActionView::TestCase assert_equal 1, place_in_line_for(@hold_1) assert_equal 2, place_in_line_for(hold_3) end - - test "hold_status" do - end end diff --git a/test/lib/certificate/generator_test.rb b/test/lib/certificate/generator_test.rb index 804e5c7bc..3e88c8eb0 100644 --- a/test/lib/certificate/generator_test.rb +++ b/test/lib/certificate/generator_test.rb @@ -4,7 +4,9 @@ module Certificate class GeneratorTest < ActiveSupport::TestCase test "can generate a certificate" do generator = Generator.new(code: "ABCD-1234") - generator.generate + assert_nothing_raised do + generator.generate + end end end end diff --git a/test/lib/map/chicago_test.rb b/test/lib/map/chicago_test.rb index f43626e9a..77d21efb6 100644 --- a/test/lib/map/chicago_test.rb +++ b/test/lib/map/chicago_test.rb @@ -3,7 +3,9 @@ module Map class ChicagoTest < ActiveSupport::TestCase test "runs with no data" do - Chicago.new({}).to_xml + assert_nothing_raised do + Chicago.new({}).to_xml + end end test "adds styles to svg" do diff --git a/test/models/adjustment_test.rb b/test/models/adjustment_test.rb index 461eb593b..e0af7b15c 100644 --- a/test/models/adjustment_test.rb +++ b/test/models/adjustment_test.rb @@ -2,11 +2,13 @@ class AdjustmentTest < ActiveSupport::TestCase test "factory definitions" do - create(:fine_adjustment) - create(:membership_adjustment) - create(:donation_adjustment) - create(:cash_payment_adjustment) - create(:square_payment_adjustment) + assert_nothing_raised do + create(:fine_adjustment) + create(:membership_adjustment) + create(:donation_adjustment) + create(:cash_payment_adjustment) + create(:square_payment_adjustment) + end end test "records member paying account balance" do diff --git a/test/models/hold_test.rb b/test/models/hold_test.rb index c59596c4f..6db6f84bc 100644 --- a/test/models/hold_test.rb +++ b/test/models/hold_test.rb @@ -8,6 +8,7 @@ class HoldTest < ActiveSupport::TestCase member_double.expect(:upcoming_appointment_of, nil, [hold]) hold.upcoming_appointment end + assert_mock member_double end test "new hold" do diff --git a/test/models/loan_test.rb b/test/models/loan_test.rb index a37420966..b9fb4f681 100644 --- a/test/models/loan_test.rb +++ b/test/models/loan_test.rb @@ -26,15 +26,19 @@ class LoanTest < ActiveSupport::TestCase test "an uncountable item can have multiple active loans" do item = create(:item) - 2.times do - create(:loan, item: item, uniquely_numbered: false) + assert_nothing_raised do + 2.times do + create(:loan, item: item, uniquely_numbered: false) + end end end test "can update an active loan" do loan = create(:loan) loan.due_at = Date.current.end_of_day - loan.save! + assert_nothing_raised do + loan.save! + end end %i[pending maintenance retired].each do |status| @@ -220,6 +224,7 @@ class LoanTest < ActiveSupport::TestCase member_double.expect(:upcoming_appointment_of, nil, [loan]) loan.upcoming_appointment end + assert_mock member_double end test "scope #overdue contains only overdue loans" do diff --git a/test/models/member_test.rb b/test/models/member_test.rb index 8d8c57892..929686df3 100644 --- a/test/models/member_test.rb +++ b/test/models/member_test.rb @@ -260,6 +260,8 @@ class MemberTest < ActiveSupport::TestCase test "can destroy member with renewals" do loan = create(:overdue_loan) renew_loan(loan) - loan.member.destroy + assert_nothing_raised do + loan.member.destroy + end end end diff --git a/test/models/membership_test.rb b/test/models/membership_test.rb index bf080ff51..b045bebc3 100644 --- a/test/models/membership_test.rb +++ b/test/models/membership_test.rb @@ -201,7 +201,9 @@ class MembershipTest < ActiveSupport::TestCase membership = create(:membership, member: member) member2 = create(:member) - create(:membership, member: member2, started_at: membership.started_at) + assert_nothing_raised do + create(:membership, member: member2, started_at: membership.started_at) + end end test "next_start_date_for_member with a pending membership" do diff --git a/test/models/notification_test.rb b/test/models/notification_test.rb index e1daba239..8f5153332 100644 --- a/test/models/notification_test.rb +++ b/test/models/notification_test.rb @@ -2,6 +2,8 @@ class NotificationTest < ActiveSupport::TestCase test "factory definitions" do - create(:notification) + assert_nothing_raised do + create(:notification) + end end end diff --git a/test/nulls/null_borrow_policy_test.rb b/test/nulls/null_borrow_policy_test.rb index 8c0d148ea..64d55d7b1 100644 --- a/test/nulls/null_borrow_policy_test.rb +++ b/test/nulls/null_borrow_policy_test.rb @@ -6,6 +6,6 @@ class NullBorrowPolicyTest < ActiveSupport::TestCase end test "borrow policy API" do - @policy.member_renewable? + assert_equal false, @policy.member_renewable? end end diff --git a/test/nulls/null_item_test.rb b/test/nulls/null_item_test.rb index 3a1113403..53a2b01dd 100644 --- a/test/nulls/null_item_test.rb +++ b/test/nulls/null_item_test.rb @@ -6,7 +6,7 @@ class NullItemTest < ActiveSupport::TestCase end test "item API" do - @item.holds.active.count - @item.active? + assert_equal 0, @item.holds.active.count + assert_equal false, @item.active? end end diff --git a/test/system/admin/holds_test.rb b/test/system/admin/holds_test.rb index 1bf220fb7..c806c3b39 100644 --- a/test/system/admin/holds_test.rb +++ b/test/system/admin/holds_test.rb @@ -162,10 +162,10 @@ def setup @inactive_hold = create(:ended_hold, item: @item) visit admin_item_holds_path(@item) - find("[data-hold-id='#{@active_hold.id}']") + assert_selector("[data-hold-id='#{@active_hold.id}']") click_on "Ended" - find("[data-hold-id='#{@inactive_hold.id}']") + assert_selector("[data-hold-id='#{@inactive_hold.id}']") end test "reordering holds" do diff --git a/test/system/admin/items_test.rb b/test/system/admin/items_test.rb index 3c5ccdc5a..baf5aa34c 100644 --- a/test/system/admin/items_test.rb +++ b/test/system/admin/items_test.rb @@ -90,6 +90,7 @@ class ItemsTest < ApplicationSystemTestCase end test "editing an item's photo" do + skip "TODO rotate photo and verify that it was saved" audited_as_admin do @item = create(:item, :with_image) end @@ -97,8 +98,6 @@ class ItemsTest < ApplicationSystemTestCase visit admin_item_url(@item) click_on "Edit Photo" - - # TODO rotate photo and verify that it was saved end test "accessing an item's history after deleting a category" do diff --git a/test/system/admin/reports/monthly_activities_test.rb b/test/system/admin/reports/monthly_activities_test.rb index 51b381e4f..b373894f2 100644 --- a/test/system/admin/reports/monthly_activities_test.rb +++ b/test/system/admin/reports/monthly_activities_test.rb @@ -54,82 +54,83 @@ def teardown test "table is populated accordingly" do visit admin_reports_monthly_activities_url + assert_selector ".monthly-adjustments" within(".monthly-adjustments") do # ║ ║ Activity ║ Members ║ Appointments ║ within("thead > tr:nth-child(1)") do - find("th:nth-child(2)").assert_text("Activity") - find("th:nth-child(3)").assert_text("Members") - find("th:nth-child(4)").assert_text("Appointments") + within("th:nth-child(2)") { assert_text("Activity") } + within("th:nth-child(3)") { assert_text("Members") } + within("th:nth-child(4)") { assert_text("Appointments") } end # ║ Month ║ Loans ║ Members ║ New ║ Pending ║ Scheduled ║ Completed ║ within("thead > tr:nth-child(2)") do - find("th:nth-child(1)").assert_text("Month") + within("th:nth-child(1)") { assert_text("Month") } - find("th:nth-child(2)").assert_text("Loans") - find("th:nth-child(3)").assert_text("Members") + within("th:nth-child(2)") { assert_text("Loans") } + within("th:nth-child(3)") { assert_text("Members") } - find("th:nth-child(4)").assert_text("New") - find("th:nth-child(5)").assert_text("Pending") + within("th:nth-child(4)") { assert_text("New") } + within("th:nth-child(5)") { assert_text("Pending") } - find("th:nth-child(6)").assert_text("Scheduled") - find("th:nth-child(7)").assert_text("Completed") + within("th:nth-child(6)") { assert_text("Scheduled") } + within("th:nth-child(7)") { assert_text("Completed") } end # ║ November 2021 ║ 0 ║ 0 ║ 1 ║ 0 ║ 0 ║ 0 ║ within("tbody > tr:nth-child(1)") do - find("td:nth-child(1)").assert_text("November 2021") + within("td:nth-child(1)") { assert_text("November 2021") } - find("td:nth-child(2)").assert_text("0") - find("td:nth-child(3)").assert_text("0") + within("td:nth-child(2)") { assert_text("0") } + within("td:nth-child(3)") { assert_text("0") } - find("td:nth-child(4)").assert_text("1") - find("td:nth-child(5)").assert_text("0") + within("td:nth-child(4)") { assert_text("1") } + within("td:nth-child(5)") { assert_text("0") } - find("td:nth-child(6)").assert_text("0") - find("td:nth-child(7)").assert_text("0") + within("td:nth-child(6)") { assert_text("0") } + within("td:nth-child(7)") { assert_text("0") } end # ║ December 2021 ║ 1 ║ 1 ║ 0 ║ 0 ║ 1 ║ 1 ║ within("tbody > tr:nth-child(2)") do - find("td:nth-child(1)").assert_text("December 2021") + within("td:nth-child(1)") { assert_text("December 2021") } - find("td:nth-child(2)").assert_text("1") - find("td:nth-child(3)").assert_text("1") + within("td:nth-child(2)") { assert_text("1") } + within("td:nth-child(3)") { assert_text("1") } - find("td:nth-child(4)").assert_text("0") - find("td:nth-child(5)").assert_text("0") + within("td:nth-child(4)") { assert_text("0") } + within("td:nth-child(5)") { assert_text("0") } - find("td:nth-child(6)").assert_text("1") - find("td:nth-child(7)").assert_text("1") + within("td:nth-child(6)") { assert_text("1") } + within("td:nth-child(7)") { assert_text("1") } end # ║ January 2022 ║ 2 ║ 1 ║ 2 ║ 1 ║ 2 ║ 1 ║ within("tbody > tr:nth-child(3)") do - find("td:nth-child(1)").assert_text("January 2022") + within("td:nth-child(1)") { assert_text("January 2022") } - find("td:nth-child(2)").assert_text("2") - find("td:nth-child(3)").assert_text("1") + within("td:nth-child(2)") { assert_text("2") } + within("td:nth-child(3)") { assert_text("1") } - find("td:nth-child(4)").assert_text("2") - find("td:nth-child(5)").assert_text("1") + within("td:nth-child(4)") { assert_text("2") } + within("td:nth-child(5)") { assert_text("1") } - find("td:nth-child(6)").assert_text("2") - find("td:nth-child(7)").assert_text("1") + within("td:nth-child(6)") { assert_text("2") } + within("td:nth-child(7)") { assert_text("1") } end # ║ Total ║ 3 ║ 2 ║ 3 ║ 1 ║ 3 ║ 2 ║ within("tfoot > tr") do - find("td:nth-child(1)").assert_text("Total") + within("td:nth-child(1)") { assert_text("Total") } - find("td:nth-child(2)").assert_text("3") - find("td:nth-child(3)").assert_text("2") + within("td:nth-child(2)") { assert_text("3") } + within("td:nth-child(3)") { assert_text("2") } - find("td:nth-child(4)").assert_text("3") - find("td:nth-child(5)").assert_text("1") + within("td:nth-child(4)") { assert_text("3") } + within("td:nth-child(5)") { assert_text("1") } - find("td:nth-child(6)").assert_text("3") - find("td:nth-child(7)").assert_text("2") + within("td:nth-child(6)") { assert_text("3") } + within("td:nth-child(7)") { assert_text("2") } end end end diff --git a/yarn.lock b/yarn.lock index e1393ca51..447637e01 100644 --- a/yarn.lock +++ b/yarn.lock @@ -265,22 +265,22 @@ resolved "https://registry.yarnpkg.com/@pkgjs/parseargs/-/parseargs-0.11.0.tgz#a77ea742fab25775145434eb1d2328cf5013ac33" integrity sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg== -"@rails/actioncable@^7.0", "@rails/actioncable@^7.1.3": - version "7.1.3" - resolved "https://registry.yarnpkg.com/@rails/actioncable/-/actioncable-7.1.3.tgz#4db480347775aeecd4dde2405659eef74a458881" - integrity sha512-ojNvnoZtPN0pYvVFtlO7dyEN9Oml1B6IDM+whGKVak69MMYW99lC2NOWXWeE3bmwEydbP/nn6ERcpfjHVjYQjA== +"@rails/actioncable@^7.0", "@rails/actioncable@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@rails/actioncable/-/actioncable-7.2.0.tgz#dee66d21bc125a9819dc8080ce896eac78d8c63f" + integrity sha512-crcsPF3skrqJkFZLxesZoyUEt8ol25XtTuOAUMdLa5qQKWTZpL8eLVW71bDCwKDQLbV2z5sBZ/XGEC0i+ZZa+A== -"@rails/actiontext@^7.1.3": - version "7.1.3" - resolved "https://registry.yarnpkg.com/@rails/actiontext/-/actiontext-7.1.3.tgz#1b7aa2732c45cbc8a5708c54457c16fb81ce3da3" - integrity sha512-jwY0LJ0xpyIWkYs6BUMY4RcwVA3jZ+bFDPvv5KpKQnw+24BhJVtBLqF0XIsROaRCyabakueRyVuSG9NNhnLTvA== +"@rails/actiontext@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@rails/actiontext/-/actiontext-7.2.0.tgz#ac05f705a5dc26e6200d3eec7a9276a587385332" + integrity sha512-vBxIQXpXRnzp24NCF2Y45SHrtcD63udfnfFidFNrZBIMlwZ1VrEMaSUrkM0Rp0bE+GZRvm53VKHjXIfaHAUoOg== dependencies: - "@rails/activestorage" ">= 7.1.0-alpha" + "@rails/activestorage" ">= 7.2.0-alpha" -"@rails/activestorage@>= 7.1.0-alpha", "@rails/activestorage@^7.1.3": - version "7.1.3" - resolved "https://registry.yarnpkg.com/@rails/activestorage/-/activestorage-7.1.3.tgz#e83ece6c5fd94b3ddf30a8cf3b8f78cad049e596" - integrity sha512-B+RFYAU8vdTPFg0IJcRp2ey0Qw9hpcUOqHHcWqftDJ76ZMBi9+m/UUeMJlNsSd0l9eD+1HLlFSo1X//cY4yiDw== +"@rails/activestorage@>= 7.2.0-alpha", "@rails/activestorage@^7.1.3": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@rails/activestorage/-/activestorage-7.2.0.tgz#bc03b52a687ba2bb9d2e6381f25795cda037494e" + integrity sha512-jXK9tKDZn/j+ZeJuFdrtyrLNLWjzYRyp+mejWTfSp+egAp1okXsdfFNe8jqqgwcP8gytqJSPwo0sZwQVdQpuIA== dependencies: spark-md5 "^3.0.1"