Skip to content

Commit

Permalink
Enable previews by default in test environment.
Browse files Browse the repository at this point in the history
Previews are currently enabled in development environment only.
Since previews can be very useful for testing,
enable them by default in test environment too.
  • Loading branch information
BigBigDoudou committed May 19, 2021
1 parent b81ed42 commit c5636a7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/view_component/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Engine < Rails::Engine # :nodoc:
options = app.config.view_component

options.render_monkey_patch_enabled = true if options.render_monkey_patch_enabled.nil?
options.show_previews = Rails.env.development? if options.show_previews.nil?
options.show_previews = Rails.env.development? || Rails.env.test? if options.show_previews.nil?
options.preview_route ||= ViewComponent::Base.preview_route
options.preview_controller ||= ViewComponent::Base.preview_controller

Expand Down

0 comments on commit c5636a7

Please sign in to comment.