repository-manager 0.0.7 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. data/Gemfile.lock +9 -12
  2. data/README.md +152 -115
  3. data/app/models/{app_file.rb → repo_file.rb} +3 -3
  4. data/app/models/repo_folder.rb +60 -0
  5. data/app/models/{repository.rb → repo_item.rb} +10 -10
  6. data/app/models/sharing.rb +58 -0
  7. data/app/models/sharings_member.rb +6 -0
  8. data/app/uploaders/{repository_uploader.rb → repo_file_uploader.rb} +1 -1
  9. data/db/migrate/20131018214212_create_repository_manager.rb +9 -17
  10. data/lib/generators/repository_manager/install_generator.rb +1 -3
  11. data/lib/generators/repository_manager/templates/initializer.rb +5 -10
  12. data/lib/repository-manager.rb +4 -4
  13. data/lib/repository_manager/engine.rb +0 -1
  14. data/lib/repository_manager/has_repository.rb +140 -129
  15. data/lib/repository_manager/version.rb +1 -1
  16. data/repository-manager.gemspec +4 -5
  17. data/spec/dummy/config/locales/en.yml +1 -8
  18. data/spec/dummy/db/development.sqlite3 +0 -0
  19. data/spec/dummy/db/migrate/20131016193722_create_users.rb +11 -11
  20. data/spec/dummy/db/migrate/20131016193834_create_groups.rb +10 -10
  21. data/spec/dummy/db/migrate/20131016194207_create_groups_users.rb +5 -5
  22. data/spec/dummy/db/migrate/20131018214212_create_repository_manager.rb +9 -17
  23. data/spec/dummy/db/schema.rb +16 -16
  24. data/spec/dummy/db/test.sqlite3 +0 -0
  25. data/spec/factories/{app_file.rb → repo_file.rb} +1 -1
  26. data/spec/factories/{folder.rb → repo_folder.rb} +1 -1
  27. data/spec/has_repository_spec.rb +107 -107
  28. data/spec/models/associations_spec.rb +45 -45
  29. data/spec/models/repository_spec.rb +51 -27
  30. data/spec/models/share_spec.rb +39 -39
  31. metadata +15 -37
  32. data/app/models/folder.rb +0 -54
  33. data/app/models/share.rb +0 -58
  34. data/app/models/shares_item.rb +0 -10
  35. data/db/migrate/20131025085844_add_file_to_repositories.rb +0 -8
  36. data/db/migrate/20131025085845_add_file_to_files.rb +0 -5
  37. data/spec/dummy/db/migrate/20131025085844_add_file_to_repositories.rb +0 -8
  38. data/spec/dummy/db/migrate/20131025085845_add_file_to_files.rb +0 -5
@@ -1,19 +1,10 @@
1
1
  class CreateRepositoryManager < ActiveRecord::Migration
2
2
 
3
3
  def change
4
- #create_table :permissions do |t|
5
- # t.boolean :can_create, :default => false
6
- # t.boolean :can_read, :default => false
7
- # t.boolean :can_update, :default => false
8
- # t.boolean :can_delete, :default => false
9
- # t.boolean :can_share, :default => false
10
- #end
11
4
 
12
- create_table :shares do |t|
13
- #t.integer :permission_id
14
- #t.integer :user_id
5
+ create_table :sharings do |t|
15
6
  t.references :owner, polymorphic: true
16
- t.integer :repository_id
7
+ t.references :repo_item
17
8
  t.boolean :can_create, :default => false
18
9
  t.boolean :can_read, :default => false
19
10
  t.boolean :can_update, :default => false
@@ -21,19 +12,20 @@ class CreateRepositoryManager < ActiveRecord::Migration
21
12
  t.boolean :can_share, :default => false
22
13
  end
23
14
 
24
- create_table :shares_items do |t|
25
- t.integer :share_id
26
- #t.integer :item_type
27
- #t.integer :item_id
28
- t.references :item, polymorphic: true
15
+ create_table :sharings_members do |t|
16
+ t.references :sharing
17
+ t.references :member, polymorphic: true
29
18
  t.boolean :can_add, :default => false
30
19
  t.boolean :can_remove, :default => false
31
20
  end
32
21
 
33
- create_table :repositories do |t|
22
+ create_table :repo_items do |t|
34
23
  t.references :owner, polymorphic: true
35
24
  t.string :ancestry
36
25
  t.string :name
26
+ t.float :file_size
27
+ t.string :content_type
28
+ t.string :file
37
29
  t.string :type
38
30
  end
39
31
  end
@@ -11,7 +11,7 @@
11
11
  #
12
12
  # It's strongly recommended that you check this file into your version control system.
13
13
 
14
- ActiveRecord::Schema.define(version: 20131025085845) do
14
+ ActiveRecord::Schema.define(version: 20131018214212) do
15
15
 
16
16
  create_table "groups", force: true do |t|
17
17
  t.string "name"
@@ -25,34 +25,34 @@ ActiveRecord::Schema.define(version: 20131025085845) do
25
25
  t.integer "user_id", null: false
26
26
  end
27
27
 
28
- create_table "repositories", force: true do |t|
28
+ create_table "repo_items", force: true do |t|
29
29
  t.integer "owner_id"
30
30
  t.string "owner_type"
31
31
  t.string "ancestry"
32
32
  t.string "name"
33
- t.string "type"
34
33
  t.float "file_size"
35
34
  t.string "content_type"
36
35
  t.string "file"
36
+ t.string "type"
37
37
  end
38
38
 
39
- create_table "shares", force: true do |t|
39
+ create_table "sharings", force: true do |t|
40
40
  t.integer "owner_id"
41
41
  t.string "owner_type"
42
- t.integer "repository_id"
43
- t.boolean "can_create", default: false
44
- t.boolean "can_read", default: false
45
- t.boolean "can_update", default: false
46
- t.boolean "can_delete", default: false
47
- t.boolean "can_share", default: false
42
+ t.integer "repo_item_id"
43
+ t.boolean "can_create", default: false
44
+ t.boolean "can_read", default: false
45
+ t.boolean "can_update", default: false
46
+ t.boolean "can_delete", default: false
47
+ t.boolean "can_share", default: false
48
48
  end
49
49
 
50
- create_table "shares_items", force: true do |t|
51
- t.integer "share_id"
52
- t.integer "item_id"
53
- t.string "item_type"
54
- t.boolean "can_add", default: false
55
- t.boolean "can_remove", default: false
50
+ create_table "sharings_members", force: true do |t|
51
+ t.integer "sharing_id"
52
+ t.integer "member_id"
53
+ t.string "member_type"
54
+ t.boolean "can_add", default: false
55
+ t.boolean "can_remove", default: false
56
56
  end
57
57
 
58
58
  create_table "users", force: true do |t|
Binary file
@@ -1,5 +1,5 @@
1
1
  FactoryGirl.define do
2
- factory :app_file do
2
+ factory :repo_file do
3
3
  file { fixture_file }
4
4
  #sequence :password do |n|
5
5
  # 'secret'
@@ -1,5 +1,5 @@
1
1
  FactoryGirl.define do
2
- factory :folder do
2
+ factory :repo_folder do
3
3
  sequence :name do |n|
4
4
  'Folder'
5
5
  end
@@ -13,222 +13,222 @@ describe 'HasRepository' do
13
13
  end
14
14
 
15
15
  it "should be associate with shares" do
16
- share = Share.create
17
- @user1.shares << share
18
- expect(@user1.shares.last).to eq(share)
16
+ sharing = Sharing.create
17
+ @user1.sharings << sharing
18
+ expect(@user1.sharings.last).to eq(sharing)
19
19
  end
20
20
 
21
- it "can add a file to repository" do
21
+ it "can add a file to repo_item" do
22
22
  #TODO
23
23
  end
24
24
 
25
- it "can add a folder to repository" do
25
+ it "can add a folder to repo_item" do
26
26
  #TODO
27
27
  end
28
28
 
29
- it 'can share his own repository with other users' do
30
- rep = FactoryGirl.create(:app_file)
29
+ it 'can share his own repo_item with other users' do
30
+ rep = FactoryGirl.create(:repo_file)
31
31
  rep.owner = @user1
32
32
  rep.save
33
33
 
34
- #expect(@user1.shares.count).to eq(0)
35
- #expect(@user2.shares.count).to eq(0)
36
- #expect(@user3.shares.count).to eq(0)
37
- #expect(@user1.shares_owners.count).to eq(0)
38
- #expect(@user2.shares_owners.count).to eq(0)
39
- #expect(@user3.shares_owners.count).to eq(0)
34
+ #expect(@user1.sharings.count).to eq(0)
35
+ #expect(@user2.sharings.count).to eq(0)
36
+ #expect(@user3.sharings.count).to eq(0)
37
+ #expect(@user1.sharings_owners.count).to eq(0)
38
+ #expect(@user2.sharings_owners.count).to eq(0)
39
+ #expect(@user3.sharings_owners.count).to eq(0)
40
40
 
41
- #Add the 2 users to items
42
- items = []
43
- items << @user2
44
- items << @user3
41
+ #Add the 2 users to members
42
+ members = []
43
+ members << @user2
44
+ members << @user3
45
45
 
46
- @user1.share(rep, items)
46
+ @user1.share(rep, members)
47
47
 
48
- #expect(@user1.shares.count).to eq(0)
49
- expect(@user2.shares.count).to eq(1)
50
- expect(@user3.shares.count).to eq(1)
51
- expect(@user1.shares_owners.count).to eq(1)
52
- expect(@user2.repositories.count).to eq(0)
53
- #expect(@user2.shared_repositories.count).to eq(1)
48
+ #expect(@user1.sharings.count).to eq(0)
49
+ expect(@user2.sharings.count).to eq(1)
50
+ expect(@user3.sharings.count).to eq(1)
51
+ expect(@user1.sharings_owners.count).to eq(1)
52
+ expect(@user2.repo_items.count).to eq(0)
53
+ #expect(@user2.sharingd_repo_items.count).to eq(1)
54
54
 
55
- #expect(@user2.shares_owners.count).to eq(0)
56
- #expect(@user3.shares_owners.count).to eq(0)
55
+ #expect(@user2.sharings_owners.count).to eq(0)
56
+ #expect(@user3.sharings_owners.count).to eq(0)
57
57
 
58
58
  end
59
59
 
60
- it 'can not share a repository without shares and without the permission' do
61
- rep = FactoryGirl.create(:app_file)
60
+ it 'can not share a repo_item without sharings and without the permission' do
61
+ rep = FactoryGirl.create(:repo_file)
62
62
  rep.owner = @user3
63
63
  rep.save
64
64
 
65
- items = []
66
- items << @user2
65
+ members = []
66
+ members << @user2
67
67
 
68
- @user1.share(rep, items)
68
+ @user1.share(rep, members)
69
69
 
70
- expect(@user2.shares.count).to eq(0)
71
- expect(@user1.shares_owners.count).to eq(0)
70
+ expect(@user2.sharings.count).to eq(0)
71
+ expect(@user1.sharings_owners.count).to eq(0)
72
72
  end
73
73
 
74
- it 'can not share a repository with share but without the permission' do
75
- rep = FactoryGirl.create(:folder)
74
+ it 'can not share a repo_item with sharing but without the permission' do
75
+ rep = FactoryGirl.create(:repo_folder)
76
76
  rep.owner = @user3
77
77
  rep.save
78
78
 
79
- items = []
80
- items << @user2
79
+ members = []
80
+ members << @user2
81
81
 
82
82
  # here user3 can share because he is the owner
83
- @user3.share(rep, items)
83
+ @user3.share(rep, members)
84
84
  # here user2 should can share because he has the authorisation
85
- items = []
86
- items << @user1
87
- @user2.share(rep, items)
85
+ members = []
86
+ members << @user1
87
+ @user2.share(rep, members)
88
88
 
89
- expect(@user1.shares.count).to eq(0)
90
- expect(@user2.shares_owners.count).to eq(0)
89
+ expect(@user1.sharings.count).to eq(0)
90
+ expect(@user2.sharings_owners.count).to eq(0)
91
91
  end
92
92
 
93
- it 'can share a repository with share and with the permission' do
94
- rep = FactoryGirl.create(:folder)
93
+ it 'can share a repo_item with sharing and with the permission' do
94
+ rep = FactoryGirl.create(:repo_folder)
95
95
  rep.owner = @user3
96
96
  rep.save
97
97
 
98
- items = []
99
- items << @user2
98
+ members = []
99
+ members << @user2
100
100
 
101
101
  #Here user3 let user2 share this repo too
102
- options = {repo_permissions: {can_share: true}}
102
+ options = {repo_item_permissions: {can_share: true}}
103
103
 
104
104
  # here user3 can share because he is the owner
105
- @user3.share(rep, items, options)
105
+ @user3.share(rep, members, options)
106
106
  # here user2 should can share because he has the authorisation
107
- items = []
108
- items << @user1
109
- @user2.share(rep, items)
107
+ members = []
108
+ members << @user1
109
+ @user2.share(rep, members)
110
110
 
111
- expect(@user1.shares.count).to eq(1)
112
- expect(@user2.shares_owners.count).to eq(1)
111
+ expect(@user1.sharings.count).to eq(1)
112
+ expect(@user2.sharings_owners.count).to eq(1)
113
113
  end
114
114
 
115
- it 'default shares permissions are to false' do
116
- rep = FactoryGirl.create(:folder)
115
+ it 'default sharings permissions are to false' do
116
+ rep = FactoryGirl.create(:repo_folder)
117
117
  rep.owner = @user3
118
118
  rep.save
119
119
 
120
- items = []
121
- items << @user2
120
+ members = []
121
+ members << @user2
122
122
 
123
123
  #Here user3 let user2 share this repo too
124
- options = {repo_permissions: {can_read: true, can_share: true}}
124
+ options = {repo_item_permissions: {can_read: true, can_share: true}}
125
125
 
126
126
  # here user3 can share because he is the owner
127
- @user3.share(rep, items, options)
127
+ @user3.share(rep, members, options)
128
128
  # here user2 should can share because he has the authorisation
129
129
  # But he has only the authorisation of read (can_read = true), He can't share with more permissions
130
- items = []
131
- items << @user1
130
+ members = []
131
+ members << @user1
132
132
  #Here the permissions should be : :can_read => true, and all others false
133
- @user2.share(rep, items)
133
+ @user2.share(rep, members)
134
134
 
135
- share_of_user_1 = @user1.shares.last
135
+ sharing_of_user_1 = @user1.sharings.last
136
136
 
137
- expect(share_of_user_1.can_read?).to eq(false)
138
- expect(share_of_user_1.can_update?).to eq(false)
139
- expect(share_of_user_1.can_share?).to eq(false)
140
- #expect(@user1.shares.count).to eq(1)
141
- #expect(@user2.shares_owners.count).to eq(1)
137
+ expect(sharing_of_user_1.can_read?).to eq(false)
138
+ expect(sharing_of_user_1.can_update?).to eq(false)
139
+ expect(sharing_of_user_1.can_share?).to eq(false)
140
+ #expect(@user1.sharings.count).to eq(1)
141
+ #expect(@user2.sharings_owners.count).to eq(1)
142
142
  end
143
143
 
144
- it 'can share a repository with share and with restricted permissions' do
145
- rep = FactoryGirl.create(:folder)
144
+ it 'can share a repo_item with sharing and with restricted permissions' do
145
+ rep = FactoryGirl.create(:repo_folder)
146
146
  rep.owner = @user3
147
147
  rep.save
148
148
 
149
- items = []
150
- items << @user2
149
+ members = []
150
+ members << @user2
151
151
 
152
152
  #Here user3 let user2 share this repo too
153
- options = {repo_permissions: {can_read: true, can_share: true}}
153
+ options = {repo_item_permissions: {can_read: true, can_share: true}}
154
154
 
155
155
  # here user3 can share because he is the owner
156
- @user3.share(rep, items, options)
156
+ @user3.share(rep, members, options)
157
157
  # here user2 should can share because he has the authorisation
158
158
  # But he has only the authorisation of read (can_read = true), He can't share with more permissions
159
- items = []
160
- items << @user1
159
+ members = []
160
+ members << @user1
161
161
 
162
- options = {repo_permissions: {can_read: true, can_update: true, can_share: true}}
162
+ options = {repo_item_permissions: {can_read: true, can_update: true, can_share: true}}
163
163
 
164
164
  #Here the permissions should be : :can_read => true, :can_share => true and all others false
165
- @user2.share(rep, items, options)
165
+ @user2.share(rep, members, options)
166
166
 
167
- share_of_user_1 = @user1.shares.last
167
+ sharing_of_user_1 = @user1.sharings.last
168
168
 
169
- expect(share_of_user_1.can_read?).to eq(true)
170
- expect(share_of_user_1.can_update?).to eq(false)
171
- expect(share_of_user_1.can_share?).to eq(true)
172
- #expect(@user1.shares.count).to eq(1)
173
- #expect(@user2.shares_owners.count).to eq(1)
169
+ expect(sharing_of_user_1.can_read?).to eq(true)
170
+ expect(sharing_of_user_1.can_update?).to eq(false)
171
+ expect(sharing_of_user_1.can_share?).to eq(true)
172
+ #expect(@user1.sharings.count).to eq(1)
173
+ #expect(@user2.sharings_owners.count).to eq(1)
174
174
  end
175
175
 
176
- it 'can share a repository with share permissions' do
177
- rep = FactoryGirl.create(:folder)
176
+ it 'can share a repo_item with sharing permissions' do
177
+ rep = FactoryGirl.create(:repo_folder)
178
178
  rep.owner = @user3
179
179
  rep.save
180
180
 
181
- items = []
182
- items << @user2
181
+ members = []
182
+ members << @user2
183
183
 
184
- options = {share_permissions: {can_add: true, can_remove: false}}
184
+ options = {sharing_permissions: {can_add: true, can_remove: false}}
185
185
 
186
186
  # here user3 can share because he is the owner
187
- @user3.share(rep, items, options)
187
+ @user3.share(rep, members, options)
188
188
 
189
- share_item_of_user_2 = @user2.shares_items.last
189
+ sharing_member_of_user_2 = @user2.sharings_members.last
190
190
 
191
- expect(share_item_of_user_2.can_add?).to eq(true)
192
- expect(share_item_of_user_2.can_remove?).to eq(false)
193
- #expect(@user1.shares.count).to eq(1)
194
- #expect(@user2.shares_owners.count).to eq(1)
191
+ expect(sharing_member_of_user_2.can_add?).to eq(true)
192
+ expect(sharing_member_of_user_2.can_remove?).to eq(false)
193
+ #expect(@user1.sharings.count).to eq(1)
194
+ #expect(@user2.sharings_owners.count).to eq(1)
195
195
  end
196
196
 
197
- it 'can share a repository with ancestor share permissions' do
198
- parent = FactoryGirl.create(:folder)
197
+ it 'can share a repo_item with ancestor sharing permissions' do
198
+ parent = FactoryGirl.create(:repo_folder)
199
199
  parent.owner = @user3
200
200
  middle = @user3.create_folder('Middle', parent)
201
201
  children = @user3.create_folder('Children', middle)
202
202
 
203
- file = FactoryGirl.build(:app_file)
203
+ file = FactoryGirl.build(:repo_file)
204
204
  file.owner = @user3
205
205
  file.save
206
206
 
207
- children.add_repository(file)
207
+ children.add(file)
208
208
 
209
- options = {repo_permissions: {can_read: true, can_update: true, can_share: false}}
209
+ options = {repo_item_permissions: {can_read: true, can_update: true, can_share: false}}
210
210
  @user3.share(parent, @user1, options)
211
211
 
212
- options = {repo_permissions: {can_read: true, can_update: true, can_share: true}}
212
+ options = {repo_item_permissions: {can_read: true, can_update: true, can_share: true}}
213
213
  @user3.share(children, @user1, options)
214
214
 
215
215
  @user1.share(middle, @user2)
216
- expect(@user2.shares.count).to eq(0)
216
+ expect(@user2.sharings.count).to eq(0)
217
217
  @user1.share(file, @user2)
218
- expect(@user2.shares.count).to eq(1)
218
+ expect(@user2.sharings.count).to eq(1)
219
219
  end
220
220
 
221
221
  it "can create a folder" do
222
222
  folder = @user1.create_folder('test folder')
223
- #folder = @user1.repositories.last
223
+ #folder = @user1.repo_items.last
224
224
  expect(folder.name).to eq('test folder')
225
- expect(folder.type).to eq('Folder')
225
+ expect(folder.type).to eq('RepoFolder')
226
226
  end
227
227
 
228
228
  it "can create a file" do
229
229
  file = @user1.create_file(File.open("#{Rails.root}/../fixture/textfile.txt"))
230
230
  expect(file.name).to eq('textfile.txt')
231
- expect(@user1.repositories.count).to eq(1)
231
+ expect(@user1.repo_items.count).to eq(1)
232
232
  end
233
233
 
234
234
  end
@@ -4,47 +4,47 @@ describe "Associations" do
4
4
 
5
5
  it "test if user can have a own file" do
6
6
  user = FactoryGirl.build(:user)
7
- file = Repository.new
7
+ file = RepoItem.new
8
8
  file.owner = user
9
9
  expect(file.owner).to eq(user)
10
10
  end
11
11
 
12
- it "test if user can have a own share" do
12
+ it "test if user can have a own sharing" do
13
13
  user = User.new
14
- share = Share.new
15
- share.owner = user
16
- expect(share.owner).to eq(user)
14
+ sharing = Sharing.new
15
+ sharing.owner = user
16
+ expect(sharing.owner).to eq(user)
17
17
  end
18
18
 
19
19
  it "should be possible for a user to share a file" do
20
20
 
21
21
  user = FactoryGirl.create(:user)
22
22
  user2 = FactoryGirl.create(:user)
23
- expect(user2.shares.count).to eq(0)
24
- expect(user.repositories.count).to eq(0)
23
+ expect(user2.sharings.count).to eq(0)
24
+ expect(user.repo_items.count).to eq(0)
25
25
 
26
- file = Repository.new
26
+ file = RepoItem.new
27
27
  file.owner = user
28
28
 
29
- #pp user.repositories
29
+ #pp user.repo_items
30
30
 
31
- share = Share.new(can_read:true, can_create:true)
32
- share.owner = user
33
- file.shares << share
34
- shareItem = SharesItem.new
35
- shareItem.item=user2
36
- share.shares_items << shareItem
31
+ sharing = Sharing.new(can_read:true, can_create:true)
32
+ sharing.owner = user
33
+ file.sharings << sharing
34
+ sharings_member = SharingsMember.new
35
+ sharings_member.member=user2
36
+ sharing.sharings_members << sharings_member
37
37
 
38
- #expect(user2.shares.count).to eq(0)
39
- #expect(file.shares.count).to eq(0)
38
+ #expect(user2.sharings.count).to eq(0)
39
+ #expect(file.sharings.count).to eq(0)
40
40
 
41
- #shareItem.save
42
- #share.save
41
+ #SharingsMember.save
42
+ #sharing.save
43
43
  file.save
44
44
 
45
- expect(user.repositories.count).to eq(1)
46
- expect(user2.shares.count).to eq(1)
47
- expect(file.shares.count).to eq(1)
45
+ expect(user.repo_items.count).to eq(1)
46
+ expect(user2.sharings.count).to eq(1)
47
+ expect(file.sharings.count).to eq(1)
48
48
  end
49
49
 
50
50
  it "should be possible for a group to share a file" do
@@ -53,37 +53,37 @@ describe "Associations" do
53
53
  user2 = FactoryGirl.create(:user)
54
54
  group = FactoryGirl.create(:group)
55
55
  group2 = FactoryGirl.create(:group)
56
- expect(group.shares.count).to eq(0)
57
- expect(group.repositories.count).to eq(0)
56
+ expect(group.sharings.count).to eq(0)
57
+ expect(group.repo_items.count).to eq(0)
58
58
 
59
- file = Repository.new
59
+ file = RepoItem.new
60
60
  file.owner = user
61
61
 
62
- #pp user.repositories
62
+ #pp user.repo_items
63
63
 
64
- share = Share.new(can_read:true, can_create:true)
65
- share.owner = group
66
- file.shares << share
67
- shareItem = SharesItem.new
68
- shareItem.item=group2
69
- share.shares_items << shareItem
64
+ sharing = Sharing.new(can_read:true, can_create:true)
65
+ sharing.owner = group
66
+ file.sharings << sharing
67
+ sm = SharingsMember.new
68
+ sm.member=group2
69
+ sharing.sharings_members << sm
70
70
 
71
- #expect(user2.shares.count).to eq(0)
72
- #expect(file.shares.count).to eq(0)
71
+ #expect(user2.sharings.count).to eq(0)
72
+ #expect(file.sharings.count).to eq(0)
73
73
 
74
- #shareItem.save
75
- #share.save
74
+ #SharingsMember.save
75
+ #sharing.save
76
76
  file.save
77
77
 
78
- expect(user.repositories.count).to eq(1)
79
- expect(user2.shares.count).to eq(0)
80
- expect(user.shares.count).to eq(0)
81
- expect(group.repositories.count).to eq(0)
82
- expect(group.shares.count).to eq(0)
83
- #Il est auteur d'un share
84
- expect(group.shares_owners.count).to eq(1)
85
- expect(group2.shares.count).to eq(1)
86
- expect(file.shares.count).to eq(1)
78
+ expect(user.repo_items.count).to eq(1)
79
+ expect(user2.sharings.count).to eq(0)
80
+ expect(user.sharings.count).to eq(0)
81
+ expect(group.repo_items.count).to eq(0)
82
+ expect(group.sharings.count).to eq(0)
83
+ #Il est auteur d'un sharing
84
+ expect(group.sharings_owners.count).to eq(1)
85
+ expect(group2.sharings.count).to eq(1)
86
+ expect(file.sharings.count).to eq(1)
87
87
  end
88
88
 
89
89
  end