Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Let ActiveStorage tests pass only for Disk #30030

Merged
merged 1 commit into from Aug 1, 2017

Conversation

claudiob
Copy link
Member

@claudiob claudiob commented Aug 1, 2017

If you have a "service/configurations.yml" file, but every single line is
commented out, then an error occurs when running tests:

git:active-storage-import~/code/rails/activestorage$ rake
~/code/rails/activestorage/test/test_helper.rb:17:in `<top (required)>': undefined method `deep_symbolize_keys' for false:FalseClass (NoMethodError)
	from ~/code/rails/activestorage/test/controllers/direct_uploads_controller_test.rb:1:in `require'

The reason is that YAML.load(..an empty file content..) simply returns false, and not {}.

This PR fixes this behavior so tests can also run when no remote service
is available.

Summary

Provide a general description of the code changes in your pull
request... were there any bugs you had fixed? If so, mention them. If
these bugs have open GitHub issues, be sure to tag them here as well,
to keep the conversation linked together.

Other Information

If there's anything else that's important and relevant to your pull
request, mention that information here. This could include
benchmarks, or other information.

If you are updating any of the CHANGELOG files or are asked to update the
CHANGELOG files by reviewers, please add the CHANGELOG entry at the top of the file.

Finally, if your pull request affects documentation or any non-code
changes, guidelines for those changes are available
here

Thanks for contributing to Rails!

If you have a "service/configurations.yml" file, but every single line is
commented out, then an error occurs when running tests:

```
git:active-storage-import~/code/rails/activestorage$ rake
~/code/rails/activestorage/test/test_helper.rb:17:in `<top (required)>': undefined method `deep_symbolize_keys' for false:FalseClass (NoMethodError)
	from ~/code/rails/activestorage/test/controllers/direct_uploads_controller_test.rb:1:in `require'
```

The reason is that `YAML.load(..an empty file content..)` simply returns `false`, and not `{}`.

This PR fixes this behavior so tests can also run when no remote service
is available.
@rails-bot
Copy link

warning Warning warning

  • Pull requests are usually filed against the master branch for this repo, but this one is against active-storage-import. Please double check that you specified the right target!

@claudiob claudiob mentioned this pull request Aug 1, 2017
3 tasks
@guilleiguaran guilleiguaran merged commit d66fade into rails:active-storage-import Aug 1, 2017
@claudiob claudiob deleted the only-disk branch August 1, 2017 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants