From af0128860fa4aa24124c0748b3a7c8e3bad41de2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 5 Sep 2023 11:21:43 +0000 Subject: [PATCH] Bump view_component from 2.78.0 to 3.5.0 Note version 3.0 removed the `controller` and `request` methods used in component tests, introducing `vc_test_controller` and `vc_test_request` instead. Bumps [view_component](https://github.com/viewcomponent/view_component) from 2.78.0 to 3.5.0. - [Release notes](https://github.com/viewcomponent/view_component/releases) - [Changelog](https://github.com/ViewComponent/view_component/blob/main/docs/CHANGELOG.md) - [Commits](https://github.com/viewcomponent/view_component/compare/v2.78.0...v3.5.0) --- updated-dependencies: - dependency-name: view_component dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- Gemfile | 2 +- Gemfile.lock | 6 +++--- spec/components/admin/budgets/index_component_spec.rb | 4 ++-- spec/components/admin/search_component_spec.rb | 2 +- spec/components/budgets/ballot/ballot_component_spec.rb | 2 +- .../components/budgets/investments/ballot_component_spec.rb | 4 ++-- .../budgets/investments/filters_component_spec.rb | 2 +- .../sdg_management/relations/index_component_spec.rb | 4 ++-- spec/rails_helper.rb | 2 +- 9 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Gemfile b/Gemfile index 0c0a22290..0682c9a0b 100644 --- a/Gemfile +++ b/Gemfile @@ -61,7 +61,7 @@ gem "turbolinks", "~> 5.2.1" gem "turnout", "~> 2.5.0" gem "uglifier", "~> 4.2.0" gem "uuidtools", "~> 2.2.0" -gem "view_component", "~> 2.78.0" +gem "view_component", "~> 3.5.0" gem "whenever", "~> 1.0.0", require: false gem "wicked_pdf", "~> 2.7.0" gem "wkhtmltopdf-binary", "~> 0.12.6" diff --git a/Gemfile.lock b/Gemfile.lock index c46b0cce3..58ff98c39 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -636,8 +636,8 @@ GEM uniform_notifier (1.16.0) uuidtools (2.2.0) version_gem (1.1.3) - view_component (2.78.0) - activesupport (>= 5.0.0, < 8.0) + view_component (3.5.0) + activesupport (>= 5.2.0, < 8.0) concurrent-ruby (~> 1.0) method_source (~> 1.0) warden (1.2.9) @@ -765,7 +765,7 @@ DEPENDENCIES turnout (~> 2.5.0) uglifier (~> 4.2.0) uuidtools (~> 2.2.0) - view_component (~> 2.78.0) + view_component (~> 3.5.0) web-console (~> 4.2.0) whenever (~> 1.0.0) wicked_pdf (~> 2.7.0) diff --git a/spec/components/admin/budgets/index_component_spec.rb b/spec/components/admin/budgets/index_component_spec.rb index 9ec63f2b3..5e7082c3e 100644 --- a/spec/components/admin/budgets/index_component_spec.rb +++ b/spec/components/admin/budgets/index_component_spec.rb @@ -2,8 +2,8 @@ require "rails_helper" describe Admin::Budgets::IndexComponent, controller: Admin::BudgetsController do before do - allow_any_instance_of(Admin::BudgetsController).to receive(:valid_filters).and_return(["all"]) - allow_any_instance_of(Admin::BudgetsController).to receive(:current_filter).and_return("all") + allow(vc_test_controller).to receive(:valid_filters).and_return(["all"]) + allow(vc_test_controller).to receive(:current_filter).and_return("all") end describe "#phase_progress_text" do diff --git a/spec/components/admin/search_component_spec.rb b/spec/components/admin/search_component_spec.rb index 196735d52..40b136262 100644 --- a/spec/components/admin/search_component_spec.rb +++ b/spec/components/admin/search_component_spec.rb @@ -4,7 +4,7 @@ describe Admin::SearchComponent do describe "#hidden_current_filter_tag" do context "controller responds to current_filter", controller: ApplicationController do it "is present when the controller has a current filter" do - allow(controller).to receive(:current_filter).and_return("all") + allow(vc_test_controller).to receive(:current_filter).and_return("all") render_inline Admin::SearchComponent.new(label: "Search") diff --git a/spec/components/budgets/ballot/ballot_component_spec.rb b/spec/components/budgets/ballot/ballot_component_spec.rb index 132b90b46..2daf54097 100644 --- a/spec/components/budgets/ballot/ballot_component_spec.rb +++ b/spec/components/budgets/ballot/ballot_component_spec.rb @@ -2,7 +2,7 @@ require "rails_helper" describe Budgets::Ballot::BallotComponent do include Rails.application.routes.url_helpers - before { request.session[:ballot_referer] = "/" } + before { vc_test_request.session[:ballot_referer] = "/" } describe "link to group" do let(:budget) { create(:budget, :balloting) } diff --git a/spec/components/budgets/investments/ballot_component_spec.rb b/spec/components/budgets/investments/ballot_component_spec.rb index 72e813761..85ad2f0ed 100644 --- a/spec/components/budgets/investments/ballot_component_spec.rb +++ b/spec/components/budgets/investments/ballot_component_spec.rb @@ -8,7 +8,7 @@ describe Budgets::Investments::BallotComponent do Budgets::Investments::BallotComponent.new( investment: investment, investment_ids: [], - ballot: Budget::Ballot.where(budget: budget, user: controller.current_user).first_or_create! + ballot: Budget::Ballot.where(budget: budget, user: vc_test_controller.current_user).first_or_create! ) end @@ -51,7 +51,7 @@ describe Budgets::Investments::BallotComponent do Budgets::Investments::BallotComponent.new( investment: investment, investment_ids: [], - ballot: Budget::Ballot.where(budget: budget, user: controller.current_user).first_or_create! + ballot: Budget::Ballot.where(budget: budget, user: vc_test_controller.current_user).first_or_create! ) end diff --git a/spec/components/budgets/investments/filters_component_spec.rb b/spec/components/budgets/investments/filters_component_spec.rb index a711f2c3b..a0691f0de 100644 --- a/spec/components/budgets/investments/filters_component_spec.rb +++ b/spec/components/budgets/investments/filters_component_spec.rb @@ -2,7 +2,7 @@ require "rails_helper" describe Budgets::Investments::FiltersComponent do let(:budget) { create(:budget) } - before { allow(controller).to receive(:valid_filters) { budget.investments_filters } } + before { allow(vc_test_controller).to receive(:valid_filters) { budget.investments_filters } } around do |example| with_request_url(Rails.application.routes.url_helpers.budget_investments_path(budget)) do diff --git a/spec/components/sdg_management/relations/index_component_spec.rb b/spec/components/sdg_management/relations/index_component_spec.rb index 2f6e001f0..8f0f7ea78 100644 --- a/spec/components/sdg_management/relations/index_component_spec.rb +++ b/spec/components/sdg_management/relations/index_component_spec.rb @@ -2,9 +2,9 @@ require "rails_helper" describe SDGManagement::Relations::IndexComponent, controller: SDGManagement::RelationsController do before do - allow_any_instance_of(SDGManagement::RelationsController).to receive(:valid_filters) + allow(vc_test_controller).to receive(:valid_filters) .and_return(SDGManagement::RelationsController::FILTERS) - allow_any_instance_of(SDGManagement::RelationsController).to receive(:current_filter) + allow(vc_test_controller).to receive(:current_filter) .and_return(SDGManagement::RelationsController::FILTERS.first) end diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index 8c5176865..fca08afc1 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -24,7 +24,7 @@ require "view_component/test_helpers" module ViewComponent module TestHelpers def sign_in(user) - allow(controller).to receive(:current_user).and_return(user) + allow(vc_test_controller).to receive(:current_user).and_return(user) end def within(...)