assert_select ".notice", /^User information updated successfully/
assert_select "form#accountForm > div.form-group > div#user_description_container > div#user_description_content > textarea#user_description", user.description
- # Changing to a invalid editor should fail
- user.preferred_editor = "unknown"
- post user_account_path(user), :params => { :user => user.attributes }
- assert_response :success
- assert_template :account
- assert_select ".notice", false
- assert_select "form#accountForm > div.form-group > select#user_preferred_editor > option[selected]", false
-
- # Changing to a valid editor should work
- user.preferred_editor = "id"
- post user_account_path(user), :params => { :user => user.attributes }
- assert_response :redirect
- assert_redirected_to user_account_url(user)
- get user_account_path(user)
- assert_response :success
- assert_template :account
- assert_select ".notice", /^User information updated successfully/
- assert_select "form#accountForm > div.form-group > select#user_preferred_editor > option[selected][value=?]", "id"
-
- # Changing to the default editor should work
- user.preferred_editor = "default"
- post user_account_path(user), :params => { :user => user.attributes }
- assert_response :redirect
- assert_redirected_to user_account_url(user)
- get user_account_path(user)
- assert_response :success
- assert_template :account
- assert_select ".notice", /^User information updated successfully/
- assert_select "form#accountForm > div.form-group > select#user_preferred_editor > option[selected]", false
-
# Changing to an uploaded image should work
image = Rack::Test::UploadedFile.new("test/gpx/fixtures/a.gif", "image/gif")
post user_account_path(user), :params => { :avatar_action => "new", :user => user.attributes.merge(:avatar => image) }