Hi all,
I had some specs that were using fixture_file_upload that were
passing just fine. Then I froze edge rails to get some 2.0
functionality, then a I upgraded to trunk rspec to deal with
uninitialized constant ActionView::Helpers::JavaScriptMacrosHelper
After a couple other of tribulations, I have now gotten down to just
a couple of not passing specs, all using the fixture_file_upload.
Here's an example
it "should be invalid if uploaded file is not an image" do
@image.attributes = valid_image_attributes.merge({:uploaded_data
=> fixture_file_upload('/textfile.txt',
'text/plain')})
@image.should_not be_valid
# content_type: is not included in the list
@image.should have(1).error_on(:content_type)
end
which fails with:
2)
NoMethodError in 'Image unsaved should be invalid if uploaded file is
not an image'
You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.+
./spec/models/image_spec.rb:25:
A less than helpful error message. Any insight into what might be
causing this?
Thanks,
Les
_______________________________________________
rspec-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users