Closed ghost closed 9 years ago
Its not just during testing. Calling a validates_presence_of a carrierwave attribute will fails because the attribute won't be set until the model has been saved. Read the following:
https://github.com/carrierwaveuploader/carrierwave/wiki/how-to:-validate-uploads-with-active-record
Closing this due to lack of activity.
After updating gems shoulda validates_presence_of is kicking out an error I can't figure out.
OS X 10.7.5 ruby -v ===> ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-darwin11.0] rails -v ===> Rails 4.0.4
bundle | grep rspec Using rspec-core 2.13.1 Using rspec-expectations 2.13.0 Using rspec-mocks 2.13.1 Using rspec 2.13.0 Using guard-rspec 2.5.0 Using rspec-rails 2.13.1
bundle | grep shoulda Using shoulda-context 1.2.1 Using shoulda-matchers 2.6.0 Using shoulda 3.5.0
bundle | grep carrier Using carrierwave 0.10.0
model
spec file
rspec spec/models/video_spec.rb
non shoulda validation works
Above test results in green 'Should not allow video with no media file"