Register test routes in routes.rb
This commit is contained in:
parent
72ad8f6699
commit
0aac4caf45
|
@ -171,5 +171,11 @@ Rails.application.routes.draw do
|
|||
|
||||
get "/nodeinfo/2.1", to: "well_known/node_info#nodeinfo", as: :node_info
|
||||
|
||||
if Rails.env.test?
|
||||
get "turbo_streamable" => "turbo_streamable_test#create"
|
||||
get "turbo_streamable_blocked" => "turbo_streamable_test#blocked"
|
||||
get "turbo_streamable_not_found" => "turbo_streamable_test#not_found"
|
||||
end
|
||||
|
||||
puts "processing time of routes.rb: #{"#{(Time.zone.now - start).round(3).to_s.ljust(5, '0')}s".light_green}"
|
||||
end
|
||||
|
|
|
@ -29,16 +29,6 @@ end
|
|||
describe TurboStreamableTestController, type: :controller do
|
||||
render_views
|
||||
|
||||
before do
|
||||
routes.disable_clear_and_finalize = true
|
||||
routes.draw do
|
||||
get "turbo_streamable" => "turbo_streamable_test#create"
|
||||
get "turbo_streamable_blocked" => "turbo_streamable_test#blocked"
|
||||
get "turbo_streamable_not_found" => "turbo_streamable_test#not_found"
|
||||
end
|
||||
routes.finalize!
|
||||
end
|
||||
|
||||
shared_examples_for "it returns a toast as Turbo Stream response" do |action, message|
|
||||
subject { get action, format: :turbo_stream }
|
||||
|
||||
|
|
Loading…
Reference in New Issue