Bug Fix:868 for Users unable to download photos

This commit is contained in:
Kiran Soumya 2011-03-17 00:58:40 +05:30
parent 5457f48c2a
commit 6d113da242
4 changed files with 23 additions and 2 deletions

View 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

View file

@ -99,3 +99,7 @@ When /^I wait for "([^\"]*)" to load$/ do |page_name|
current_location == path_to(page_name) current_location == path_to(page_name)
end end
end end
Then /^I should get download alert$/ do
page.evaluate_script("window.alert = function() { return true; }")
end

View file

@ -11,8 +11,8 @@ module PhotoMover
FileUtils::mkdir_p photos_dir FileUtils::mkdir_p photos_dir
photos.each do |photo| photos.each do |photo|
current_photo_location = "#{Rails.root}/public/uploads/images/#{photo.image_filename}" current_photo_location = "#{Rails.root}/public/uploads/images/#{photo.remote_photo_name}"
new_photo_location = "#{photos_dir}/#{photo.image_filename}" new_photo_location = "#{photos_dir}/#{photo.remote_photo_name}"
FileUtils::cp current_photo_location, new_photo_location FileUtils::cp current_photo_location, new_photo_location
end end

View file

@ -21,6 +21,13 @@ describe UsersController do
end end
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 describe '#public' do
it 'renders xml' do it 'renders xml' do
sm = Factory(:status_message, :public => true, :author => @user.person) sm = Factory(:status_message, :public => true, :author => @user.person)