diff options
| author | mo khan <mo@mokhan.ca> | 2014-06-07 08:26:53 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2014-06-07 08:26:53 -0600 |
| commit | 532fa71eae4ecc096d30e2fbebcd77305889fcf6 (patch) | |
| tree | 5ff30d137dba8c96af0755b865fd04c543b15889 /spec/controllers | |
| parent | b3d59861124ece048e34fcb58c1a3ec99ed3feba (diff) | |
add ability to generate urls for different versions of an image.
Diffstat (limited to 'spec/controllers')
| -rw-r--r-- | spec/controllers/creations_controller_spec.rb | 5 | ||||
| -rw-r--r-- | spec/controllers/my/photos_controller_spec.rb | 7 |
2 files changed, 4 insertions, 8 deletions
diff --git a/spec/controllers/creations_controller_spec.rb b/spec/controllers/creations_controller_spec.rb index 692d6495..e8c9583d 100644 --- a/spec/controllers/creations_controller_spec.rb +++ b/spec/controllers/creations_controller_spec.rb @@ -5,9 +5,8 @@ describe CreationsController do let(:creation){ create(:creation, :user => user) } before(:each) do - photo = File.new(File.join(Rails.root, 'spec/fixtures/images/example.png')) - creation.add_photo(photo) - creation.photos.first.update_attribute(:image_processing, nil) + photo = 'spec/fixtures/images/example.png' + creation.photos.create(image: photo, image_processing: nil) end describe :index do diff --git a/spec/controllers/my/photos_controller_spec.rb b/spec/controllers/my/photos_controller_spec.rb index fc917f4f..75d85381 100644 --- a/spec/controllers/my/photos_controller_spec.rb +++ b/spec/controllers/my/photos_controller_spec.rb @@ -32,13 +32,10 @@ module My end describe :delete do - let!(:photo) { create(:photo) } + let!(:photo) { create(:photo, creation_id: cake.id, image_processing: nil) } before :each do - cake.photos << photo - cake.save! - photo.update_attribute(:image_processing, nil) - delete :destroy, :cake_id => cake.id, :id => photo.id + delete :destroy, cake_id: cake.id, id: photo.id end it "returns http success" do |
