From 309e733aade7df9151dd0efe8f68c3b953e0b2ad Mon Sep 17 00:00:00 2001 From: MoisesMachado Date: Fri, 28 Sep 2007 15:14:54 +0000 Subject: [PATCH] ActionItem65: corrected all test that was not passing --- app/controllers/profile_admin/membership_editor_controller.rb | 10 +++++++++- app/views/membership_editor/_enterprise.rhtml | 2 ++ app/views/membership_editor/index.rhtml | 4 ++++ app/views/profile_editor/index.rhtml | 2 +- test/fixtures/role_assignments.yml | 2 +- test/functional/admin_panel_controller_test.rb | 3 ++- test/functional/membership_editor_controller_test.rb | 23 ++++++++++++++++++++--- test/integration/activate_enterprise_test.rb | 25 ------------------------- test/integration/edit_enterprise_test.rb | 23 +++++++++++------------ test/integration/register_enterprise_test.rb | 16 +++++----------- test/integration/search_enterprise_test.rb | 7 ++----- 11 files changed, 57 insertions(+), 60 deletions(-) create mode 100644 app/views/membership_editor/_enterprise.rhtml delete mode 100644 test/integration/activate_enterprise_test.rb diff --git a/app/controllers/profile_admin/membership_editor_controller.rb b/app/controllers/profile_admin/membership_editor_controller.rb index 7046767..dd60cd3 100644 --- a/app/controllers/profile_admin/membership_editor_controller.rb +++ b/app/controllers/profile_admin/membership_editor_controller.rb @@ -1,12 +1,14 @@ class MembershipEditorController < ProfileAdminController + before_filter :logon + def index @memberships = current_user.person.memberships end def new_enterprise @enterprise = Enterprise.new() - @vitual_communities = Environment.find(:all) + @virtual_communities = Environment.find(:all) @validation_entities = Organization.find(:all) end @@ -29,4 +31,10 @@ class MembershipEditorController < ProfileAdminController def search @tagged_enterprises = Enterprise.search(params[:query]) end + + protected + + def logon + redirect_to :controller => :account unless logged_in? + end end diff --git a/app/views/membership_editor/_enterprise.rhtml b/app/views/membership_editor/_enterprise.rhtml new file mode 100644 index 0000000..1c32c0d --- /dev/null +++ b/app/views/membership_editor/_enterprise.rhtml @@ -0,0 +1,2 @@ +<%= link_to enterprise.name, '/' + enterprise.identifier %> + diff --git a/app/views/membership_editor/index.rhtml b/app/views/membership_editor/index.rhtml index 1b4346b..a15e73b 100644 --- a/app/views/membership_editor/index.rhtml +++ b/app/views/membership_editor/index.rhtml @@ -1,5 +1,9 @@

<%= _('Listing memberships')%>

+<% form_tag 'membership_editor/search' do %> + <%= _('Search') %> <%= text_field_tag 'query' %> +<% end %> +