Skip to content
This repository has been archived by the owner on Jun 29, 2023. It is now read-only.

Commit

Permalink
the registration#edit respond to xml with the user info
Browse files Browse the repository at this point in the history
  • Loading branch information
flype committed Mar 18, 2011
1 parent a2cbfa4 commit 6f005a5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
5 changes: 4 additions & 1 deletion app/controllers/devise/registrations_controller.rb
Expand Up @@ -33,7 +33,10 @@ def create

# GET /resource/edit
def edit
render_with_scope :edit
respond_with(resource) do |format|
format.any(*navigational_formats) {}
format.html { render_with_scope :edit }
end
end

# PUT /resource
Expand Down
8 changes: 7 additions & 1 deletion test/integration/registerable_test.rb
Expand Up @@ -205,7 +205,13 @@ class RegistrationTest < ActionController::IntegrationTest
user = sign_in_as_user
put user_registration_path(:format => 'xml'), :user => { :current_password => '123456', :email => 'user.new@test.com' }
assert_response :success
assert_equal user.reload.email, 'user.new@test.com'
end

test 'a user retriew his information should return the information in XML' do
user = sign_in_as_user
get edit_user_registration_path(:format => 'xml')
assert_response :success
assert response.body.include? %(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<user>)
end

test 'a user update information with invalid data in XML format should return invalid response' do
Expand Down

0 comments on commit 6f005a5

Please sign in to comment.