Commit 8274372944219b8e17e1150d56213bce817dc5f7
1 parent
a0b4c60e
Exists in
master
and in
29 other branches
ActionItem489: fixed the form to handle sex parameter properly
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@2104 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
2 changed files
with
7 additions
and
2 deletions
Show diff stats
app/views/profile_editor/_person.rhtml
@@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
2 | <%= f.text_field(:contact_information) %> | 2 | <%= f.text_field(:contact_information) %> |
3 | <%= f.text_field(:contact_phone) %> | 3 | <%= f.text_field(:contact_phone) %> |
4 | <%# use :size => 3 if you want 3 radios by line %> | 4 | <%# use :size => 3 if you want 3 radios by line %> |
5 | - <%= f.radio_group :profile, :sex, [ ['male',_('Male')], ['female',_('Female')] ] %> | 5 | + <%= f.radio_group :profile_data, :sex, [ ['male',_('Male')], ['female',_('Female')] ] %> |
6 | <%= f.text_field(:birth_date) %> | 6 | <%= f.text_field(:birth_date) %> |
7 | <%= f.text_field(:address) %> | 7 | <%= f.text_field(:address) %> |
8 | <%= f.text_field(:city) %> | 8 | <%= f.text_field(:city) %> |
test/functional/profile_editor_controller_test.rb
@@ -59,8 +59,13 @@ class ProfileEditorControllerTest < Test::Unit::TestCase | @@ -59,8 +59,13 @@ class ProfileEditorControllerTest < Test::Unit::TestCase | ||
59 | 59 | ||
60 | should 'saving profile info' do | 60 | should 'saving profile info' do |
61 | person = create_user('test_profile').person | 61 | person = create_user('test_profile').person |
62 | - post :edit, :profile => 'test_profile', :profile_data => { 'name' => 'new person', 'contact_information' => 'new contact information', 'address' => 'new address' } | 62 | + post :edit, :profile => 'test_profile', :profile_data => { 'name' => 'new person', 'contact_information' => 'new contact information', 'address' => 'new address', 'sex' => 'female' } |
63 | assert_redirected_to :action => 'index' | 63 | assert_redirected_to :action => 'index' |
64 | + person.reload | ||
65 | + assert_equal 'new person', person.name | ||
66 | + assert_equal 'new contact information', person.contact_information | ||
67 | + assert_equal 'new address', person.address | ||
68 | + assert_equal 'female', person.sex | ||
64 | end | 69 | end |
65 | 70 | ||
66 | should 'not permmit if not logged' do | 71 | should 'not permmit if not logged' do |