File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -23,10 +23,13 @@ def find_or_create_user
23
23
end
24
24
25
25
def find_or_create_organization ( user )
26
- user . organizations . find_or_create_by! (
26
+ org = Organization . find_or_create_by! (
27
27
vcs_id : @payload [ 'space_id' ] ,
28
28
vcs_type : 'AssemblaOrganization'
29
29
)
30
+ membership = org . memberships . find_or_create_by ( user : user )
31
+ membership . update ( role : 'admin' )
32
+ org
30
33
end
31
34
32
35
def create_org_subscription ( user , organization_id )
Original file line number Diff line number Diff line change 66
66
expect ( service_org . vcs_type ) . to eq ( expected_attrs [ :vcs_type ] )
67
67
expect ( service_org . vcs_id ) . to eq ( expected_attrs [ :vcs_id ] )
68
68
end
69
+
70
+ it 'has admin membership' do
71
+ service_org = service . find_or_create_organization ( user )
72
+ expect ( service_org . memberships . find_by ( user : user ) . role ) . to eq ( 'admin' )
73
+ end
69
74
end
70
75
71
76
describe '#create_org_subscription' do
You can’t perform that action at this time.
0 commit comments