diff --git a/spec/factories/routing/static_route.rb b/spec/factories/routing/static_route.rb new file mode 100644 index 000000000..88db715ce --- /dev/null +++ b/spec/factories/routing/static_route.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +FactoryBot.define do + factory :static_route, class: Routing::RoutingPlanStaticRoute do + routing_plan { create :routing_plan, :with_static_routes } + vendor { FactoryBot.create :vendor } + + trait :filled do + network_prefix { FactoryBot.create :network_prefix } + end + end +end diff --git a/spec/features/routing/routing_plan_static_routes/index_routing_plan_static_route_spec.rb b/spec/features/routing/routing_plan_static_routes/index_routing_plan_static_route_spec.rb new file mode 100644 index 000000000..5a6de8f1e --- /dev/null +++ b/spec/features/routing/routing_plan_static_routes/index_routing_plan_static_route_spec.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +RSpec.describe 'Index Routing Plan Static Route', :js do + include_context :login_as_admin + + it 'n+1 checks' do + static_routes = create_list :static_route, 2, :filled + visit static_routes_path + static_routes.each do |static_route| + expect(page).to have_css('.resource_id_link', text: static_route.id) + end + end +end