Skip to content

Commit

Permalink
Bump view_component from 2.78.0 to 3.5.0
Browse files Browse the repository at this point in the history
Note this version removes the `controller` method in component tests and
introduces `vc_test_controller` 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](ViewComponent/view_component@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] <support@github.com>
  • Loading branch information
dependabot[bot] authored and javierm committed Sep 5, 2023
1 parent 41d44aa commit 75e03a7
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions spec/components/admin/budgets/index_component_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

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
Expand Down
2 changes: 1 addition & 1 deletion spec/components/admin/search_component_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
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")

Expand Down
2 changes: 1 addition & 1 deletion spec/components/budgets/ballot/ballot_component_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

describe Budgets::Ballot::BallotComponent do
include Rails.application.routes.url_helpers
before { request.session[:ballot_referer] = "/" }
before { vc_test_controller.request.session[:ballot_referer] = "/" }

describe "link to group" do
let(:budget) { create(:budget, :balloting) }
Expand Down
4 changes: 2 additions & 2 deletions spec/components/budgets/investments/ballot_component_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
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

Expand Down Expand Up @@ -51,7 +51,7 @@
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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

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

Expand Down
2 changes: 1 addition & 1 deletion spec/rails_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
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(...)
Expand Down

0 comments on commit 75e03a7

Please sign in to comment.