diff options
author | Francis Irving <francis@mysociety.org> | 2010-07-15 14:32:05 +0100 |
---|---|---|
committer | Francis Irving <francis@mysociety.org> | 2010-07-15 14:32:05 +0100 |
commit | 3ecbcf1abd036965740813583302ac9c344b8b7a (patch) | |
tree | da36354c367a6985f9b3b1fb39b360b5d84f99a5 /spec/models | |
parent | 2b91bbb4db04b6f3935478a3f6e8a0fe61fc06fb (diff) |
Get key dependency right. Test for draft pictures.
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/profile_photo_spec.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/models/profile_photo_spec.rb b/spec/models/profile_photo_spec.rb index b7d45b8ae..1e33c5b61 100644 --- a/spec/models/profile_photo_spec.rb +++ b/spec/models/profile_photo_spec.rb @@ -32,6 +32,16 @@ describe ProfilePhoto, "when constructing a new photo" do profile_photo.image.columns.should == 96 profile_photo.image.rows.should == 96 end + + it 'should accept a draft PNG and not resize it' do + data = load_file_fixture("parrot.png") + profile_photo = ProfilePhoto.new(:draft => true, :data => data) + profile_photo.valid?.should == true + profile_photo.image.format.should == 'PNG' + profile_photo.image.columns.should == 198 + profile_photo.image.rows.should == 289 + end + end |