DEV: Don't run dev-only code in specs (#23427)

This was causing the following notice to be printed out when running system specs:

```
I did no detect a custom `config/dev.yml` file, creating one for you where you can amend defaults.
```

(since 61571bee43)
This commit is contained in:
Jarek Radosz 2023-09-06 02:14:57 +02:00 committed by GitHub
parent 769e0c0d5b
commit ee3ac739f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -16,7 +16,7 @@ module DiscourseDev
if File.exist?(file_path)
user_config = YAML.load_file(file_path, permitted_classes: [Date])
else
puts "I did no detect a custom `config/dev.yml` file, creating one for you where you can amend defaults."
puts "Did not detect `config/dev.yml`, creating one for you where you can amend defaults."
FileUtils.cp(default_file_path, file_path)
user_config = {}
end

View File

@ -86,7 +86,7 @@ module Faker
def available_methods
methods = super
methods << :image if ::DiscourseDev.config.post[:include_images]
methods << :image if Rails.env.dev? && ::DiscourseDev.config.post[:include_images]
methods
end
end