Commit 28af7f8b74270fc8966925754d90441d448e4eed

Authored by AntonioTerceiro
1 parent cc2dd78a

ActionItem295: switching profile as public/private (still missing UI for

setting this)


git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1809 3f533792-8f58-4932-b0fe-aaf55b0a4547
test/functional/profile_editor_controller_test.rb
... ... @@ -207,6 +207,23 @@ class ProfileEditorControllerTest < Test::Unit::TestCase
207 207 assert_equal false, Profile['ze'].public_profile
208 208 end
209 209  
  210 + should 'display profile publication option in edit profile screen' do
  211 + profile = Profile['ze']
  212 + get :edit, :profile => 'ze'
  213 + assert_tag :tag => 'input', :attributes => { :type => 'checkbox', :checked => 'checked', :name => 'profile_data[public_profile]', :value => 'true' }
  214 + assert_tag :tag => 'input', :attributes => { :type => 'hidden', :name => 'profile_data[public_profile]', :value => false }
  215 + end
  216 +
  217 + should 'save profile publication option set to true' do
  218 + post :edit, :profile => 'ze', :profile_data => { :public_profile => 'true' }
  219 + assert_equal true, Profile['ze'].public_profile
  220 + end
  221 +
  222 + should 'save profile publication option set to false' do
  223 + post :edit, :profile => 'ze', :profile_data => { :public_profile => 'false' }
  224 + assert_equal false, Profile['ze'].public_profile
  225 + end
  226 +
210 227 should 'show error messages for'
211 228  
212 229 should 'edit enterprise' do
... ...