diff options
author | Benjamin Neff <benjamin@coding4coffee.ch> | 2019-07-04 03:30:38 +0300 |
---|---|---|
committer | Benjamin Neff <benjamin@coding4coffee.ch> | 2019-07-04 03:30:38 +0300 |
commit | e63fa7a398d1525ad534c970c21c6372184b359e (patch) | |
tree | 0c7900286e4f63adc8df673e1cc9703a390d39d4 /spec | |
parent | 11caf4f86fdd276b63d7b7bfe64418f36115e623 (diff) | |
parent | b42c9896bc62e17be267e682f280f39877108e53 (diff) |
Merge branch 'next-minor' into develop
Diffstat (limited to 'spec')
-rw-r--r-- | spec/controllers/photos_controller_spec.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/spec/controllers/photos_controller_spec.rb b/spec/controllers/photos_controller_spec.rb index 424eeb235..f9f17762e 100644 --- a/spec/controllers/photos_controller_spec.rb +++ b/spec/controllers/photos_controller_spec.rb @@ -44,7 +44,7 @@ describe PhotosController, :type => :controller do describe '#create' do before do allow(@controller).to receive(:file_handler).and_return(uploaded_photo) - @params = {:photo => {:user_file => uploaded_photo, :aspect_ids => "all"} } + @params = {photo: {user_file: uploaded_photo, aspect_ids: "all", pending: true}} end it "creates a photo" do @@ -67,11 +67,13 @@ describe PhotosController, :type => :controller do expect(Photo.last.author).to eq(alice.person) end - it 'can set the photo as the profile photo' do + it "can set the photo as the profile photo and unpends the photo" do old_url = alice.person.profile.image_url @params[:photo][:set_profile_photo] = true post :create, params: @params - expect(alice.reload.person.profile.image_url).not_to eq(old_url) + new_url = alice.reload.person.profile.image_url + expect(new_url).not_to eq(old_url) + expect(Photo.find_by(remote_photo_name: new_url.rpartition("_").last).pending).to be_falsey end end |