You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 6, 2021. It is now read-only.
Re-factor to use implicit subject and review expectations.
We use mocks with .and_call_original because the methods being
tested must execute the rest of the method to decorate the returned
File. Alternately, we could use .and_return(@active_record_file_mock)
to inject the correct type of file [build it from a Factory, because
otherwise, the mocked file and the real File will eventually be out of
sync.
Remove deep "implementation" testing, e.g. "calls #create!".
Instead of specing the return behavior of "store!" and
"retrieve!", should we spec the return behaviour of only "retrieve!"
and then specifiy that "store!" and "retrieve!" should return the same
thing?
tested must execute the rest of the method to decorate the returned
File. Alternately, we could use .and_return(@active_record_file_mock)
to inject the correct type of file [build it from a Factory, because
otherwise, the mocked file and the real File will eventually be out of
sync.
"retrieve!", should we spec the return behaviour of only "retrieve!"
and then specifiy that "store!" and "retrieve!" should return the same
thing?
File
viauploader
andshould_receive
(write it as a stub):carrierwave-activerecord/spec/lib/carrierwave-activerecord/storage/storage_provider_spec.rb
Line 89 in 0b48c23
carrierwave-activerecord/spec/lib/carrierwave-activerecord/storage/storage_provider_spec.rb
Line 83 in 0b48c23
carrierwave-activerecord/spec/lib/carrierwave-activerecord/storage/storage_provider_spec.rb
Line 120 in 0b48c23
its
with a tag to call abefore
block?carrierwave-activerecord/spec/lib/carrierwave-activerecord/storage/storage_provider_spec.rb
Line 124 in 0b48c23
The text was updated successfully, but these errors were encountered: