From 22235d76bf9b1c6ae51f580dffb22703ff6ad318 Mon Sep 17 00:00:00 2001
From: AntonioTerceiro
Date: Thu, 22 May 2008 21:26:18 +0000
Subject: [PATCH] ActionItem295: editing public_content
---
app/views/profile_editor/edit.rhtml | 9 +++++++++
test/functional/profile_editor_controller_test.rb | 15 +++++++++++++++
2 files changed, 24 insertions(+), 0 deletions(-)
diff --git a/app/views/profile_editor/edit.rhtml b/app/views/profile_editor/edit.rhtml
index 755fa7e..3a6a938 100644
--- a/app/views/profile_editor/edit.rhtml
+++ b/app/views/profile_editor/edit.rhtml
@@ -20,6 +20,15 @@
<%= radio_button 'profile_data', 'public_profile', 'false' %>
+
+ <%= _("This profile's content is:") %>
+
+ <%= radio_button 'profile_data', 'public_content', 'true' %>
+
+
+ <%= radio_button 'profile_data', 'public_content', 'false' %>
+
+
<%= select_categories(:profile_data, _('Select the categories of your interest'), 1) %>
diff --git a/test/functional/profile_editor_controller_test.rb b/test/functional/profile_editor_controller_test.rb
index dfddb2b..736de8e 100644
--- a/test/functional/profile_editor_controller_test.rb
+++ b/test/functional/profile_editor_controller_test.rb
@@ -205,6 +205,21 @@ class ProfileEditorControllerTest < Test::Unit::TestCase
assert_equal false, Profile['ze'].public_profile
end
+ should 'display public_content field for editing' do
+ profile = Profile['ze']
+ get :edit, :profile => 'ze'
+ assert_tag :tag => 'input', :attributes => { :type => 'radio', :checked => 'checked', :name => 'profile_data[public_content]', :value => 'true' }
+ assert_tag :tag => 'input', :attributes => { :type => 'radio', :name => 'profile_data[public_content]', :value => 'false' }
+ end
+
+ should 'display properly that the content is non-public' do
+ profile = Profile['ze']
+ profile.update_attributes(:public_content => false)
+ get :edit, :profile => 'ze'
+ assert_tag :tag => 'input', :attributes => { :type => 'radio', :checked => 'checked', :name => 'profile_data[public_content]', :value => 'false' }
+ assert_tag :tag => 'input', :attributes => { :type => 'radio', :name => 'profile_data[public_content]', :value => 'true' }
+ end
+
should 'show error messages for invalid foundation_year' do
org = Organization.create!(:name => 'test org', :identifier => 'testorg')
post :edit, :profile => 'testorg', :profile_data => { :foundation_year => 'aaa' }
--
libgit2 0.21.2