Browse Source

More tests

update-version-test
Kat 12 months ago
parent
commit
9f69198768
  1. 4
      spec/components/search_component_spec.rb
  2. 3
      spec/config/routes_spec.rb

4
spec/components/search_component_spec.rb

@ -6,7 +6,9 @@ RSpec.describe SearchComponent, type: :component do
let(:value) { nil }
before do
allow(request).to receive(:path).and_return("/users")
# rubocop:disable RSpec/AnyInstance
allow_any_instance_of(ActionDispatch::TestRequest).to receive(:path).and_return("/users")
# rubocop:enable RSpec/AnyInstance
render_inline(described_class.new(current_user:, search_label:, value:))
end

3
spec/config/routes_spec.rb

@ -7,10 +7,11 @@ RSpec.describe "routes.rb" do
let(:active_admin_routes_prefix) { "/admin" }
let(:rails_routes_prefix) { "/rails" }
let(:turbo_routes_pattern) { "_historical_location" }
let(:view_component_pattern) { "_system_test_entrypoint" }
let(:project_routes) do
all_routes.reject do |r|
r.starts_with?(active_admin_routes_prefix) || r.starts_with?(rails_routes_prefix) ||
r.include?(turbo_routes_pattern)
r.include?(turbo_routes_pattern) || r.include?(view_component_pattern)
end
end

Loading…
Cancel
Save