Skip to content

Commit

Permalink
Merge pull request #105 from Shopify/view_in_test
Browse files Browse the repository at this point in the history
Use viewing in test mode by default
  • Loading branch information
gmcgibbon authored Dec 7, 2023
2 parents bfbac5b + 571f36e commit d18ae2b
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 d18ae2b

Please sign in to comment.