Bug Fix:868 for Users unable to download photos
This commit is contained in:
parent
5457f48c2a
commit
6d113da242
4 changed files with 23 additions and 2 deletions
10
features/download_photos.feature
Normal file
10
features/download_photos.feature
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
@javascript
|
||||
Feature: Download Photos
|
||||
|
||||
Scenario: Download my photos
|
||||
Given I am signed in
|
||||
And I click on my name in the header
|
||||
And I follow "settings"
|
||||
Then I should be on my account settings page
|
||||
And I follow "download my photos"
|
||||
Then I should get download alert
|
||||
|
|
@ -99,3 +99,7 @@ When /^I wait for "([^\"]*)" to load$/ do |page_name|
|
|||
current_location == path_to(page_name)
|
||||
end
|
||||
end
|
||||
|
||||
Then /^I should get download alert$/ do
|
||||
page.evaluate_script("window.alert = function() { return true; }")
|
||||
end
|
||||
|
|
|
|||
|
|
@ -11,8 +11,8 @@ module PhotoMover
|
|||
FileUtils::mkdir_p photos_dir
|
||||
|
||||
photos.each do |photo|
|
||||
current_photo_location = "#{Rails.root}/public/uploads/images/#{photo.image_filename}"
|
||||
new_photo_location = "#{photos_dir}/#{photo.image_filename}"
|
||||
current_photo_location = "#{Rails.root}/public/uploads/images/#{photo.remote_photo_name}"
|
||||
new_photo_location = "#{photos_dir}/#{photo.remote_photo_name}"
|
||||
FileUtils::cp current_photo_location, new_photo_location
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -21,6 +21,13 @@ describe UsersController do
|
|||
end
|
||||
end
|
||||
|
||||
describe '#export_photos' do
|
||||
it 'returns a tar file' do
|
||||
get :export_photos
|
||||
response.header["Content-Type"].should include "application/octet-stream"
|
||||
end
|
||||
end
|
||||
|
||||
describe '#public' do
|
||||
it 'renders xml' do
|
||||
sm = Factory(:status_message, :public => true, :author => @user.person)
|
||||
|
|
|
|||
Loading…
Reference in a new issue