Permalink
Browse files

Existing users will get added to a startup immediately. See #7.

  • Loading branch information...
1 parent 5be56ec commit cf3d74d4d7741366699b8c79ba86f6421ce0e21a @fredwu fredwu committed Jul 21, 2011
@@ -111,8 +111,8 @@ jQuery ->
$('.inline_edtiable_container').delegate('form', 'submit', ->
return true if $(@).parents('.follow_button').length > 0
- inline_popup = $(@).parent().hasClass('inline_popup')
edit_target = $(@).parent().parent()
+ inline_popup = $(@).parent().hasClass('inline_popup') or edit_target.hasClass('inline_popup')
target_link = edit_target.data('target_link')
$(@).ajaxSubmit(
View
@@ -70,6 +70,9 @@ def invite_or_attach_user(role_identifier, attributes)
user = User.find_by_email(attributes[:email]) || attributes[:email] # && TODO: send an invitation email
attach_user(user, role_identifier, attributes[:member_title])
+
+ # TODO: remove the confirmation and make the target user to confirm the invite manually
+ confirm_user(user, role_identifier)
end
def attach_user(user, role_identifier = :member, member_title = '')
@@ -1,8 +1,8 @@
-.team
- h2= t('label.members')
- = render 'startups/add_user_link', :startup => startup, :role_identifier => 'member'
- = render 'users/index', :collection => startup.members, :meta => { :removable => true, :editable => true, :parent => startup, :role_identifier => 'member' }
- .clear
+.team.inline_popup data-target_link="#{startup_profile_team_path(startup)}" data-edit_target="#profile_team"
+ h2= t('label.members')
+ = render 'startups/add_user_link', :startup => startup, :role_identifier => 'member'
+ = render 'users/index', :collection => startup.members, :meta => { :removable => true, :editable => true, :parent => startup, :role_identifier => 'member' }
+ .clear
.team
h2= t('label.investors')
@@ -174,6 +174,14 @@
subject.member_title(user).should == 'CEO'
subject.user_role(user).should == 'Member'
end
+
+ it "invites the user" do
+ user = User.make!(:email => 'hello@world.com')
+ subject.invite_or_attach_user(:member, { :email => 'hello@world.com' })
+
+ subject.members.last.should == user
+ subject.user_meta(user).confirmed.should == true
+ end
end
describe "logo" do

0 comments on commit cf3d74d

Please sign in to comment.