Paperclip::Shoulda::Matchers validate content type bug or feature? #472

Closed
iamvery opened this Issue May 5, 2011 · 1 comment

Comments

Projects
None yet
3 participants

iamvery commented May 5, 2011

Working through some unit tests today I came across an issue if you attempt to validate content type supplying only allowing OR rejecting and not both:

should validate_attachment_content_type(:track).allowing(Song::TYPES)

resulted in an error saying that The error occurred while evaluating nil.join. The problem is that if ONLY allowing or rejecting is set the other remains uninitialized (nil), so during the failure_message method this error is produced.

If the functionality is desired that both must be set, this a less cryptic error should probably be produced. In my case, I assumed that allowing certain types would imply rejecting all others.. Doesn't that make sense?

I'm seeing this as well on Rails 3.0.7 with Rpsec 2 & newest paperclip.

Slightly confusing for someone new to paperclip. I think this should be fixed.

sikachu closed this in 0206259 Jul 22, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment