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