From dcf5bbd6abb0716e98bc3b133beb6278536dc9d6 Mon Sep 17 00:00:00 2001 From: JoenioCosta Date: Fri, 6 Jun 2008 23:05:37 +0000 Subject: [PATCH] ActionItem335: user is added as admin after create community --- app/controllers/my_profile/memberships_controller.rb | 2 +- test/functional/memberships_controller_test.rb | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/controllers/my_profile/memberships_controller.rb b/app/controllers/my_profile/memberships_controller.rb index 5db0c7d..c0f6f40 100644 --- a/app/controllers/my_profile/memberships_controller.rb +++ b/app/controllers/my_profile/memberships_controller.rb @@ -27,7 +27,7 @@ class MembershipsController < MyProfileController @community = Community.new(params[:community]) if request.post? if @community.save - @community.add_member(profile) + @community.add_admin(profile) redirect_to :action => 'index' end end diff --git a/test/functional/memberships_controller_test.rb b/test/functional/memberships_controller_test.rb index ec72917..d5348a4 100644 --- a/test/functional/memberships_controller_test.rb +++ b/test/functional/memberships_controller_test.rb @@ -149,6 +149,9 @@ class MembershipsControllerTest < Test::Unit::TestCase end end - should 'show task to organization administrador' + should 'current user is added as admin after create new community' do + post :new_community, :profile => profile.identifier, :community => { :name => 'My shiny new community', :description => 'This is a community devoted to anything interesting we find in the internet '} + assert_equal Profile::Roles.admin, profile.find_roles(Community.find_by_identifier('my-shiny-new-community')).first.role + end end -- libgit2 0.21.2