DG MS; test for users#export

This commit is contained in:
danielvincent 2010-10-07 15:22:03 -07:00
parent 206e10f66a
commit 0ebb597b72
3 changed files with 13 additions and 1 deletions

View file

@ -59,7 +59,7 @@ class UsersController < ApplicationController
def export
exporter = Diaspora::Exporter.new(Diaspora::Exporters::XML)
render :xml => exporter.execute(current_user)
send_data exporter.execute(current_user), :filename => "#{current_user.username}_diaspora_data.xml", :type => :xml
end
private

View file

@ -19,11 +19,15 @@
- content_for :left_pane do
%ul#settings_nav
%li=link_to 'Profile', '#', :class => 'profile'
%li=link_to 'Account', '#', :class => 'account'
%li=link_to 'Services', '#', :class => 'services'
#profile.settings_pane{:style=>"display:block;"}
= render 'users/profile'
#account.settings_pane
= link_to "download my stuff", users_export_path, :class => "button"
#services.settings_pane
= render 'users/services'

View file

@ -11,6 +11,14 @@ describe UsersController do
@user.aspect(:name => "lame-os")
end
describe '#export' do
it 'should return an xml file' do
get :export
response.header["Content-Type"].should include "application/xml"
end
end
describe '#update' do
context 'with a profile photo set' do
before do