Commit dcf5bbd6abb0716e98bc3b133beb6278536dc9d6
1 parent
72274dd9
Exists in
master
and in
29 other branches
ActionItem335: user is added as admin after create community
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1901 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
2 changed files
with
5 additions
and
2 deletions
Show diff stats
app/controllers/my_profile/memberships_controller.rb
@@ -27,7 +27,7 @@ class MembershipsController < MyProfileController | @@ -27,7 +27,7 @@ class MembershipsController < MyProfileController | ||
27 | @community = Community.new(params[:community]) | 27 | @community = Community.new(params[:community]) |
28 | if request.post? | 28 | if request.post? |
29 | if @community.save | 29 | if @community.save |
30 | - @community.add_member(profile) | 30 | + @community.add_admin(profile) |
31 | redirect_to :action => 'index' | 31 | redirect_to :action => 'index' |
32 | end | 32 | end |
33 | end | 33 | end |
test/functional/memberships_controller_test.rb
@@ -149,6 +149,9 @@ class MembershipsControllerTest < Test::Unit::TestCase | @@ -149,6 +149,9 @@ class MembershipsControllerTest < Test::Unit::TestCase | ||
149 | end | 149 | end |
150 | end | 150 | end |
151 | 151 | ||
152 | - should 'show task to organization administrador' | 152 | + should 'current user is added as admin after create new community' do |
153 | + 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 '} | ||
154 | + assert_equal Profile::Roles.admin, profile.find_roles(Community.find_by_identifier('my-shiny-new-community')).first.role | ||
155 | + end | ||
153 | 156 | ||
154 | end | 157 | end |