Skip to content

Commit

Permalink
Use viewing in test mode by default
Browse files Browse the repository at this point in the history
Uploading in test mode doesn't really make sense, unless you're using CI
maybe, but in that case it can be overridden.
  • Loading branch information
gmcgibbon committed Dec 7, 2023
1 parent 641f562 commit 571f36e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ AppProfiler.storage.credentials = { "key" => "value" }
Rails.application.config.app_profiler.storage_credentials = { "key" => "value" }
```

Note that in `development` mode the file isn't uploaded. Instead, it is viewed via the `Middleware::ViewAction`. If you want to change that, use the `middleware_action` configuration:
Note that in `development` and `test` modes the file isn't uploaded. Instead, it is viewed via the `Middleware::ViewAction`. If you want to change that, use the `middleware_action` configuration:

```ruby
Rails.application.config.app_profiler.middleware_action = AppProfiler::Middleware::UploadAction
Expand Down
2 changes: 1 addition & 1 deletion lib/app_profiler/railtie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class Railtie < Rails::Railtie
private

def default_middleware_action
if Rails.env.development?
if Rails.env.development? || Rails.env.test?
Middleware::ViewAction
else
Middleware::UploadAction
Expand Down

0 comments on commit 571f36e

Please sign in to comment.