paperclip
https://github.com/thoughtbot/paperclip
Ruby
Easy file attachment management for ActiveRecord
Paperclip::Shoulda::Matchers#validate_attachment_content_type
Ensures that the given instance or class validates the content type of
the given attachment as specified.
Example:
describe User do
it { should validate_attachment_content_type(:icon).
allowing('image/png', 'image/gif').
rejecting('text/plain', 'text/xml') }
endEdit
git clone [email protected]:thoughtbot/paperclip.git
cd paperclip
open lib/paperclip/matchers/validate_attachment_content_type_matcher.rb
Contribute
# Make a new branchgit checkout -b -your-name--update-docs-Paperclip--Shoulda--Matchers-validate_attachment_content_type-for-pr
# Commit to gitgit add lib/paperclip/matchers/validate_attachment_content_type_matcher.rbgit commit -m "better docs for Paperclip::Shoulda::Matchers#validate_attachment_content_type"
# Open pull requestgem install hub # on a mac you can `brew install hub`
hub fork
git push <your name> -your-name--update-docs-Paperclip--Shoulda--Matchers-validate_attachment_content_type-for-pr
hub pull-request
# Celebrate!