Simplify changing controllers in component tests

This commit is contained in:
Javi Martín
2021-08-10 14:54:09 +02:00
parent 403bf87744
commit 6df7f7d052
7 changed files with 11 additions and 29 deletions

View File

@@ -1,13 +1,9 @@
require "rails_helper"
describe Admin::Budgets::TableActionsComponent, type: :component do
describe Admin::Budgets::TableActionsComponent, type: :component, controller: Admin::BaseController do
let(:budget) { create(:budget) }
let(:component) { Admin::Budgets::TableActionsComponent.new(budget) }
before do
allow(ViewComponent::Base).to receive(:test_controller).and_return("Admin::BaseController")
end
it "renders links to edit and delete budget, manage investments and edit groups and manage ballots" do
render_inline component