Add ActiveSupport::Testing::FileFixtures.#18658
Conversation
|
@carlosantoniodasilva @rafaelfranca @dhh interested to hear your thoughts. The method names feel a bit awkward to me but it's the best I could come up with. |
|
🆒 |
|
Nice. @senny it would be awesome if this could be extended to support passing a file in controller requests in tests. Thoughts? |
|
Seems good to me. |
There was a problem hiding this comment.
Nit-picky thing but it should be "Returns" here, no ?
There was a problem hiding this comment.
How about: fixture_path + "files"?
|
I wonder if we should touch Other than that it seems good to me, good to have something simple builtin to help with that. |
5ae37f7 to
06c7fff
Compare
|
I changed the configuration option to @carlosantoniodasilva what do you think? |
|
Cool, I like it better 👍, do you prefer like this? Would you think that leaving the "read" logic for the developers wouldn't be fine? I mean, we could use |
|
@carlosantoniodasilva 👍 I think we can get rid of |
|
Alright, great 👍 ❤️ |
|
@carlosantoniodasilva mind a final 👀? |
There was a problem hiding this comment.
s/they provide/it provides ?
|
💚💛❤️💙💜 |
It's a thin layer to provide easy access to sample files throughout test-cases. This adds the directory `test/fixtures/files` to newly generated applications.
Add `ActiveSupport::Testing::FileFixtures`.
|
@carlosantoniodasilva thanks man!!! 💛 |
|
thank you 👍 💙 |
It's a thin layer to provide easy access to sample files throughout
test-cases. This adds the directory
test/fixtures/filesto newlygenerated applications.
This is something that came up in a discussion with @dhh
Most of our applications have helpers to access some kind of sample files. Possible use-cases are: