social_stream-base 0.22.4 → 0.23.0
Sign up to get free protection for your applications and to get access to all the features.
- data/app/controllers/activities_controller.rb +14 -12
- data/app/controllers/api_controller.rb +0 -13
- data/app/controllers/frontpage_controller.rb +0 -6
- data/app/models/activity.rb +21 -61
- data/app/models/actor.rb +4 -8
- data/app/models/audience.rb +2 -0
- data/app/models/comment.rb +2 -1
- data/app/models/group.rb +0 -2
- data/app/models/relation.rb +5 -1
- data/app/models/relation/custom.rb +17 -4
- data/app/models/tie.rb +0 -2
- data/app/models/user.rb +0 -2
- data/app/views/activities/_options.html.erb +1 -1
- data/app/views/activities/index.atom.builder +48 -0
- data/app/views/activity_objects/_activity_object.atom.erb +1 -0
- data/config/locales/en.yml +8 -0
- data/config/locales/es.yml +8 -0
- data/config/routes.rb +0 -8
- data/lib/rails/social_stream.rb +1 -1
- data/lib/social_stream-base.rb +5 -0
- data/lib/social_stream/ability/base.rb +4 -16
- data/lib/social_stream/activity_streams.rb +39 -0
- data/lib/social_stream/activity_streams/subtype.rb +11 -0
- data/lib/social_stream/activity_streams/supertype.rb +12 -0
- data/lib/social_stream/base/dependencies.rb +2 -0
- data/lib/social_stream/base/engine.rb +6 -0
- data/lib/social_stream/base/version.rb +1 -1
- data/lib/social_stream/models/object.rb +5 -0
- data/lib/social_stream/models/subject.rb +1 -1
- data/lib/social_stream/models/subtype.rb +2 -0
- data/lib/social_stream/models/supertype.rb +2 -0
- data/social_stream-base.gemspec +2 -0
- data/spec/controllers/activities_controller_spec.rb +18 -0
- data/spec/controllers/frontpage_controller_spec.rb +0 -5
- data/spec/models/activity_wall_spec.rb +96 -0
- data/spec/models/post_authorization_spec.rb +370 -0
- data/spec/models/post_spec.rb +0 -2
- data/spec/models/relation_spec.rb +22 -0
- data/spec/social_stream_activity_streams_spec.rb +16 -0
- data/spec/social_stream_spec.rb +1 -1
- metadata +27 -8
- data/app/assets/images/logos/actor/remote_subject.png +0 -0
- data/app/assets/images/logos/actor/remote_user.png +0 -0
- data/app/controllers/subjects_controller.rb +0 -7
- data/app/views/api/activity_atom_feed.atom.builder +0 -40
- data/app/views/frontpage/host_meta.xml.builder +0 -11
- data/spec/models/activity_authorization_spec.rb +0 -354
data/spec/models/post_spec.rb
CHANGED
@@ -74,5 +74,27 @@ describe Relation do
|
|
74
74
|
end
|
75
75
|
end
|
76
76
|
end
|
77
|
+
|
78
|
+
describe 'with follow permission' do
|
79
|
+
before do
|
80
|
+
@relation = Relation.create!
|
81
|
+
@relation.permissions << Permission.find_or_create_by_action('follow')
|
82
|
+
end
|
83
|
+
|
84
|
+
it 'should follow?' do
|
85
|
+
@relation.follow?.should be_true
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
describe 'without follow permission' do
|
90
|
+
before do
|
91
|
+
@relation = Relation.create!
|
92
|
+
end
|
93
|
+
|
94
|
+
it 'should follow?' do
|
95
|
+
@relation.follow?.should be_false
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
77
99
|
end
|
78
100
|
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe SocialStream::ActivityStreams do
|
4
|
+
it "should find by type" do
|
5
|
+
SocialStream::ActivityStreams.model(:person).should == User
|
6
|
+
end
|
7
|
+
|
8
|
+
it "should return Post as default model" do
|
9
|
+
SocialStream::ActivityStreams.model!(:_test).should == Post
|
10
|
+
end
|
11
|
+
|
12
|
+
it "should find by model" do
|
13
|
+
SocialStream::ActivityStreams.type(User).should == :person
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
data/spec/social_stream_spec.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: social_stream-base
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.23.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2012-
|
13
|
+
date: 2012-10-03 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: deep_merge
|
@@ -44,6 +44,22 @@ dependencies:
|
|
44
44
|
- - ! '>='
|
45
45
|
- !ruby/object:Gem::Version
|
46
46
|
version: 3.1.0
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: rails_engine_decorators
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
type: :runtime
|
56
|
+
prerelease: false
|
57
|
+
version_requirements: !ruby/object:Gem::Requirement
|
58
|
+
none: false
|
59
|
+
requirements:
|
60
|
+
- - ! '>='
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0'
|
47
63
|
- !ruby/object:Gem::Dependency
|
48
64
|
name: ancestry
|
49
65
|
requirement: !ruby/object:Gem::Requirement
|
@@ -685,8 +701,6 @@ files:
|
|
685
701
|
- app/assets/images/loading.gif
|
686
702
|
- app/assets/images/logo.png
|
687
703
|
- app/assets/images/logos/actor/group.png
|
688
|
-
- app/assets/images/logos/actor/remote_subject.png
|
689
|
-
- app/assets/images/logos/actor/remote_user.png
|
690
704
|
- app/assets/images/logos/actor/user.png
|
691
705
|
- app/assets/images/logos/contact/group.png
|
692
706
|
- app/assets/images/logos/contact/user.png
|
@@ -792,7 +806,6 @@ files:
|
|
792
806
|
- app/controllers/relation/customs_controller.rb
|
793
807
|
- app/controllers/search_controller.rb
|
794
808
|
- app/controllers/settings_controller.rb
|
795
|
-
- app/controllers/subjects_controller.rb
|
796
809
|
- app/controllers/tags_controller.rb
|
797
810
|
- app/controllers/ties_controller.rb
|
798
811
|
- app/controllers/users_controller.rb
|
@@ -848,6 +861,7 @@ files:
|
|
848
861
|
- app/views/activities/_options.html.erb
|
849
862
|
- app/views/activities/_root.html.erb
|
850
863
|
- app/views/activities/_wall.html.erb
|
864
|
+
- app/views/activities/index.atom.builder
|
851
865
|
- app/views/activities/index.html.erb
|
852
866
|
- app/views/activities/index.js.erb
|
853
867
|
- app/views/activity_actions/_follow_form.html.erb
|
@@ -855,10 +869,10 @@ files:
|
|
855
869
|
- app/views/activity_actions/_update.js.erb
|
856
870
|
- app/views/activity_actions/create.js.erb
|
857
871
|
- app/views/activity_actions/update.js.erb
|
872
|
+
- app/views/activity_objects/_activity_object.atom.erb
|
858
873
|
- app/views/activity_objects/_activity_object.html.erb
|
859
874
|
- app/views/actors/_actor.html.erb
|
860
875
|
- app/views/actors/_actor_cheesecake.html.erb
|
861
|
-
- app/views/api/activity_atom_feed.atom.builder
|
862
876
|
- app/views/audience/_list.html.erb
|
863
877
|
- app/views/audience/index.js.erb
|
864
878
|
- app/views/avatars/index.html.erb
|
@@ -915,7 +929,6 @@ files:
|
|
915
929
|
- app/views/frontpage/_caracteristics.html.erb
|
916
930
|
- app/views/frontpage/_social_networks.html.erb
|
917
931
|
- app/views/frontpage/_sponsor.html.erb
|
918
|
-
- app/views/frontpage/host_meta.xml.builder
|
919
932
|
- app/views/frontpage/index.html.erb
|
920
933
|
- app/views/groups/_group.html.erb
|
921
934
|
- app/views/groups/_group_focus_search.html.erb
|
@@ -1102,6 +1115,9 @@ files:
|
|
1102
1115
|
- lib/social_stream-base.rb
|
1103
1116
|
- lib/social_stream/ability.rb
|
1104
1117
|
- lib/social_stream/ability/base.rb
|
1118
|
+
- lib/social_stream/activity_streams.rb
|
1119
|
+
- lib/social_stream/activity_streams/subtype.rb
|
1120
|
+
- lib/social_stream/activity_streams/supertype.rb
|
1105
1121
|
- lib/social_stream/base/dependencies.rb
|
1106
1122
|
- lib/social_stream/base/engine.rb
|
1107
1123
|
- lib/social_stream/base/thinking-sphinx.rb
|
@@ -1137,6 +1153,7 @@ files:
|
|
1137
1153
|
- lib/tasks/workers.rake
|
1138
1154
|
- lib/thinking-sphinx/social_stream.rb
|
1139
1155
|
- social_stream-base.gemspec
|
1156
|
+
- spec/controllers/activities_controller_spec.rb
|
1140
1157
|
- spec/controllers/audience_controller_spec.rb
|
1141
1158
|
- spec/controllers/comments_controller_spec.rb
|
1142
1159
|
- spec/controllers/contacts_controller_spec.rb
|
@@ -1201,18 +1218,20 @@ files:
|
|
1201
1218
|
- spec/integration/navigation_spec.rb
|
1202
1219
|
- spec/integration/resque_access_spec.rb
|
1203
1220
|
- spec/models/activity_action_spec.rb
|
1204
|
-
- spec/models/activity_authorization_spec.rb
|
1205
1221
|
- spec/models/activity_spec.rb
|
1222
|
+
- spec/models/activity_wall_spec.rb
|
1206
1223
|
- spec/models/actor_spec.rb
|
1207
1224
|
- spec/models/contact_spec.rb
|
1208
1225
|
- spec/models/group_spec.rb
|
1209
1226
|
- spec/models/like_spec.rb
|
1227
|
+
- spec/models/post_authorization_spec.rb
|
1210
1228
|
- spec/models/post_spec.rb
|
1211
1229
|
- spec/models/profile_spec.rb
|
1212
1230
|
- spec/models/relation_follow_spec.rb
|
1213
1231
|
- spec/models/relation_spec.rb
|
1214
1232
|
- spec/models/tie_spec.rb
|
1215
1233
|
- spec/models/user_spec.rb
|
1234
|
+
- spec/social_stream_activity_streams_spec.rb
|
1216
1235
|
- spec/social_stream_spec.rb
|
1217
1236
|
- spec/spec_helper.rb
|
1218
1237
|
- spec/support/cancan.rb
|
Binary file
|
Binary file
|
@@ -1,40 +0,0 @@
|
|
1
|
-
atom_feed({'xmlns:activity' => 'http://activitystrea.ms/spec/1.0/'}) do |feed|
|
2
|
-
feed.title(@subject.name + ' public stream')
|
3
|
-
feed.updated(@activities.first.updated_at)
|
4
|
-
feed.author do
|
5
|
-
feed.name(@subject.name)
|
6
|
-
end
|
7
|
-
|
8
|
-
for activity in @activities
|
9
|
-
feed.entry(activity) do |entry|
|
10
|
-
if activity.class.name != "Tie" and activity.activity_verb.name == "post"
|
11
|
-
#Atom compliant for not ActivityStream readers
|
12
|
-
entry.title('Activity')
|
13
|
-
entry.summary(activity.direct_object.text)
|
14
|
-
|
15
|
-
#ActivityStream compliant
|
16
|
-
|
17
|
-
entry.author do |a|
|
18
|
-
a.name(activity.sender_subject.name)
|
19
|
-
a.tag!('activity:object-type','person')
|
20
|
-
end
|
21
|
-
|
22
|
-
entry.tag!('activity:verb',activity.activity_verb.name)
|
23
|
-
|
24
|
-
entry.tag!('activity:object') do |act_ob|
|
25
|
-
act_ob.title('Activity')
|
26
|
-
act_ob.tag!('activity:object-type','status')
|
27
|
-
act_ob.publised(activity.created_at)
|
28
|
-
end
|
29
|
-
|
30
|
-
entry.content(activity.direct_object.text,:type=>'text/html')
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
feed.link :rel => 'self', :href=>request.url
|
36
|
-
feed.link :rel => 'next', :href=>api_my_home_url+'?page='+(params[:page].to_i+1).to_s
|
37
|
-
if params[:page].to_i != 1
|
38
|
-
feed.link :rel => 'previous', :href=>api_my_home_url+'?page='+(params[:page].to_i-1).to_s
|
39
|
-
end
|
40
|
-
end
|
@@ -1,11 +0,0 @@
|
|
1
|
-
xml.instruct!
|
2
|
-
xml.XRD :xmlns => 'http://docs.oasis-open.org/ns/xri/xrd-1.0',
|
3
|
-
"xmlns:hm" => 'http://host-meta.net/ns/1.0' do
|
4
|
-
|
5
|
-
xml.tag! "hm:Host", request.host_with_port
|
6
|
-
|
7
|
-
xml.Link :rel => "lrdd",
|
8
|
-
:template => "#{ root_url }subjects/lrdd/{uri}",
|
9
|
-
:type => "application/xrd+xml"
|
10
|
-
|
11
|
-
end
|
@@ -1,354 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
module ActivityTestHelper
|
4
|
-
def create_activity(contact, relations)
|
5
|
-
@activity = Factory(:post,
|
6
|
-
:author_id => contact.sender.id,
|
7
|
-
:owner_id => contact.receiver.id,
|
8
|
-
:user_author_id => contact.sender.id,
|
9
|
-
:relation_ids => Array(Relation.normalize_id(relations))).post_activity
|
10
|
-
end
|
11
|
-
|
12
|
-
def create_ability_accessed_by(subject)
|
13
|
-
@ability = Ability.new(subject)
|
14
|
-
end
|
15
|
-
|
16
|
-
def create_ability_accessed_by_related(tie_type)
|
17
|
-
@tie = create_related_tie(tie_type)
|
18
|
-
@related = @tie.receiver_subject
|
19
|
-
@ability = Ability.new(@related)
|
20
|
-
end
|
21
|
-
|
22
|
-
def create_ability_accessed_publicly
|
23
|
-
u = Factory(:user)
|
24
|
-
@ability = Ability.new(u)
|
25
|
-
end
|
26
|
-
|
27
|
-
def create_related_tie(tie_type)
|
28
|
-
Factory(tie_type, :contact => Factory(:contact, :sender => Actor.normalize(@subject)))
|
29
|
-
end
|
30
|
-
|
31
|
-
shared_examples_for "Allows Creating" do
|
32
|
-
it "should allow create" do
|
33
|
-
@ability.should be_able_to(:create, @activity)
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
shared_examples_for "Allows Reading" do
|
38
|
-
it "should allow read" do
|
39
|
-
@ability.should be_able_to(:read, @activity)
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
shared_examples_for "Allows Updating" do
|
44
|
-
it "should allow update" do
|
45
|
-
@ability.should be_able_to(:update, @activity)
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
|
-
shared_examples_for "Allows Destroying" do
|
50
|
-
it "should allow destroy" do
|
51
|
-
@ability.should be_able_to(:destroy, @activity)
|
52
|
-
end
|
53
|
-
end
|
54
|
-
|
55
|
-
shared_examples_for "Denies Creating" do
|
56
|
-
it "should deny create" do
|
57
|
-
@ability.should_not be_able_to(:create, @activity)
|
58
|
-
end
|
59
|
-
end
|
60
|
-
|
61
|
-
shared_examples_for "Denies Reading" do
|
62
|
-
it "should deny read" do
|
63
|
-
@ability.should_not be_able_to(:read, @activity)
|
64
|
-
end
|
65
|
-
end
|
66
|
-
|
67
|
-
shared_examples_for "Denies Updating" do
|
68
|
-
it "should deny update" do
|
69
|
-
@ability.should_not be_able_to(:update, @activity)
|
70
|
-
end
|
71
|
-
end
|
72
|
-
|
73
|
-
shared_examples_for "Denies Destroying" do
|
74
|
-
it "should deny destroy" do
|
75
|
-
@ability.should_not be_able_to(:destroy, @activity)
|
76
|
-
end
|
77
|
-
end
|
78
|
-
|
79
|
-
end
|
80
|
-
|
81
|
-
describe Activity do
|
82
|
-
include ActivityTestHelper
|
83
|
-
|
84
|
-
context "user" do
|
85
|
-
before(:all) do
|
86
|
-
@subject = @user = Factory(:user)
|
87
|
-
end
|
88
|
-
|
89
|
-
context "with public activity" do
|
90
|
-
before do
|
91
|
-
contact = @user.contact_to!(@user)
|
92
|
-
create_activity(contact, Relation::Public.instance)
|
93
|
-
end
|
94
|
-
|
95
|
-
describe "sender home" do
|
96
|
-
it "should include activity" do
|
97
|
-
@activity.sender.wall(:home).should include(@activity)
|
98
|
-
end
|
99
|
-
end
|
100
|
-
|
101
|
-
describe "sender profile" do
|
102
|
-
context "accessed by alien" do
|
103
|
-
it "should include activity" do
|
104
|
-
@activity.sender.wall(:profile,
|
105
|
-
:for => Factory(:user)).should include(@activity)
|
106
|
-
end
|
107
|
-
end
|
108
|
-
|
109
|
-
context "accessed by anonymous" do
|
110
|
-
it "should include activity" do
|
111
|
-
@activity.sender.wall(:profile,
|
112
|
-
:for => nil).should include(@activity)
|
113
|
-
end
|
114
|
-
end
|
115
|
-
end
|
116
|
-
end
|
117
|
-
|
118
|
-
describe "belonging to friend" do
|
119
|
-
before do
|
120
|
-
@tie = create_related_tie(:friend)
|
121
|
-
create_activity(@tie.contact.inverse!, @tie.relation)
|
122
|
-
end
|
123
|
-
|
124
|
-
describe "accessed by sender" do
|
125
|
-
before do
|
126
|
-
create_ability_accessed_by(@tie.receiver_subject)
|
127
|
-
end
|
128
|
-
|
129
|
-
it_should_behave_like "Allows Creating"
|
130
|
-
it_should_behave_like "Allows Reading"
|
131
|
-
it_should_behave_like "Allows Updating"
|
132
|
-
it_should_behave_like "Allows Destroying"
|
133
|
-
end
|
134
|
-
|
135
|
-
describe "accessed by different friend" do
|
136
|
-
before do
|
137
|
-
create_ability_accessed_by_related :friend
|
138
|
-
end
|
139
|
-
|
140
|
-
it_should_behave_like "Denies Creating"
|
141
|
-
it_should_behave_like "Allows Reading"
|
142
|
-
it_should_behave_like "Denies Updating"
|
143
|
-
it_should_behave_like "Denies Destroying"
|
144
|
-
end
|
145
|
-
|
146
|
-
describe "accessed by acquaintance" do
|
147
|
-
before do
|
148
|
-
create_ability_accessed_by_related :acquaintance
|
149
|
-
end
|
150
|
-
|
151
|
-
it_should_behave_like "Denies Creating"
|
152
|
-
it_should_behave_like "Denies Reading"
|
153
|
-
it_should_behave_like "Denies Updating"
|
154
|
-
it_should_behave_like "Denies Destroying"
|
155
|
-
end
|
156
|
-
|
157
|
-
describe "accessed publicly" do
|
158
|
-
before do
|
159
|
-
create_ability_accessed_publicly
|
160
|
-
end
|
161
|
-
|
162
|
-
it_should_behave_like "Denies Creating"
|
163
|
-
it_should_behave_like "Denies Reading"
|
164
|
-
it_should_behave_like "Denies Updating"
|
165
|
-
it_should_behave_like "Denies Destroying"
|
166
|
-
end
|
167
|
-
end
|
168
|
-
|
169
|
-
describe "belonging to user's friend relation" do
|
170
|
-
before do
|
171
|
-
create_activity(@user.contact_to!(@user), @user.relation_custom('friend'))
|
172
|
-
end
|
173
|
-
|
174
|
-
describe "accessed by the sender" do
|
175
|
-
before do
|
176
|
-
create_ability_accessed_by(@user)
|
177
|
-
end
|
178
|
-
|
179
|
-
it_should_behave_like "Allows Creating"
|
180
|
-
it_should_behave_like "Allows Reading"
|
181
|
-
it_should_behave_like "Allows Updating"
|
182
|
-
it_should_behave_like "Allows Destroying"
|
183
|
-
end
|
184
|
-
|
185
|
-
describe "accessed by a friend" do
|
186
|
-
before do
|
187
|
-
create_ability_accessed_by_related :friend
|
188
|
-
end
|
189
|
-
|
190
|
-
it_should_behave_like "Denies Creating"
|
191
|
-
it_should_behave_like "Allows Reading"
|
192
|
-
it_should_behave_like "Denies Updating"
|
193
|
-
it_should_behave_like "Denies Destroying"
|
194
|
-
end
|
195
|
-
|
196
|
-
describe "accessed by acquaintance" do
|
197
|
-
before do
|
198
|
-
create_ability_accessed_by_related :acquaintance
|
199
|
-
end
|
200
|
-
|
201
|
-
it_should_behave_like "Denies Creating"
|
202
|
-
it_should_behave_like "Denies Reading"
|
203
|
-
it_should_behave_like "Denies Updating"
|
204
|
-
it_should_behave_like "Denies Destroying"
|
205
|
-
end
|
206
|
-
|
207
|
-
describe "accessed publicly" do
|
208
|
-
before do
|
209
|
-
create_ability_accessed_publicly
|
210
|
-
end
|
211
|
-
|
212
|
-
it_should_behave_like "Denies Creating"
|
213
|
-
it_should_behave_like "Denies Reading"
|
214
|
-
it_should_behave_like "Denies Updating"
|
215
|
-
it_should_behave_like "Denies Destroying"
|
216
|
-
end
|
217
|
-
end
|
218
|
-
|
219
|
-
describe "belonging to user's public relation" do
|
220
|
-
|
221
|
-
before do
|
222
|
-
create_activity(@user.contact_to!(@user), Relation::Public.instance)
|
223
|
-
end
|
224
|
-
|
225
|
-
describe "accessed by the sender" do
|
226
|
-
before do
|
227
|
-
create_ability_accessed_by(@user)
|
228
|
-
end
|
229
|
-
|
230
|
-
it_should_behave_like "Allows Creating"
|
231
|
-
it_should_behave_like "Allows Reading"
|
232
|
-
it_should_behave_like "Allows Updating"
|
233
|
-
it_should_behave_like "Allows Destroying"
|
234
|
-
end
|
235
|
-
|
236
|
-
describe "accessed by a friend" do
|
237
|
-
before do
|
238
|
-
create_ability_accessed_by_related :friend
|
239
|
-
end
|
240
|
-
|
241
|
-
it_should_behave_like "Denies Creating"
|
242
|
-
it_should_behave_like "Allows Reading"
|
243
|
-
it_should_behave_like "Denies Updating"
|
244
|
-
it_should_behave_like "Denies Destroying"
|
245
|
-
end
|
246
|
-
|
247
|
-
describe "accessed by acquaintance" do
|
248
|
-
before do
|
249
|
-
create_ability_accessed_by_related :acquaintance
|
250
|
-
end
|
251
|
-
|
252
|
-
it_should_behave_like "Denies Creating"
|
253
|
-
it_should_behave_like "Allows Reading"
|
254
|
-
it_should_behave_like "Denies Updating"
|
255
|
-
it_should_behave_like "Denies Destroying"
|
256
|
-
end
|
257
|
-
|
258
|
-
describe "accessed publicly" do
|
259
|
-
before do
|
260
|
-
create_ability_accessed_publicly
|
261
|
-
end
|
262
|
-
|
263
|
-
it_should_behave_like "Denies Creating"
|
264
|
-
it_should_behave_like "Allows Reading"
|
265
|
-
it_should_behave_like "Denies Updating"
|
266
|
-
it_should_behave_like "Denies Destroying"
|
267
|
-
end
|
268
|
-
end
|
269
|
-
|
270
|
-
describe "belonging to other user's public relation" do
|
271
|
-
|
272
|
-
before do
|
273
|
-
@tie = Factory(:public)
|
274
|
-
create_activity @tie.contact, Relation::Public.instance
|
275
|
-
create_ability_accessed_by @tie.receiver_subject
|
276
|
-
end
|
277
|
-
|
278
|
-
it_should_behave_like "Denies Creating"
|
279
|
-
end
|
280
|
-
|
281
|
-
describe "build to non replied contact" do
|
282
|
-
before do
|
283
|
-
@tie = Factory(:friend, :contact => Factory(:contact, :sender => @user.actor))
|
284
|
-
partner = @tie.receiver
|
285
|
-
@activity = Activity.new :author => @user.actor,
|
286
|
-
:user_author => @user.author,
|
287
|
-
:owner => partner
|
288
|
-
|
289
|
-
create_ability_accessed_by @tie.sender_subject
|
290
|
-
end
|
291
|
-
|
292
|
-
it_should_behave_like "Denies Creating"
|
293
|
-
end
|
294
|
-
end
|
295
|
-
|
296
|
-
context "group" do
|
297
|
-
before(:all) do
|
298
|
-
@subject = @group = Factory(:group)
|
299
|
-
end
|
300
|
-
|
301
|
-
describe "belonging to member tie" do
|
302
|
-
before do
|
303
|
-
@tie = create_related_tie(:member)
|
304
|
-
create_activity @tie.contact.inverse!, @tie.relation
|
305
|
-
end
|
306
|
-
|
307
|
-
describe "accessed by same member" do
|
308
|
-
before do
|
309
|
-
create_ability_accessed_by @tie.receiver_subject
|
310
|
-
end
|
311
|
-
|
312
|
-
it_should_behave_like "Allows Creating"
|
313
|
-
it_should_behave_like "Allows Reading"
|
314
|
-
it_should_behave_like "Allows Updating"
|
315
|
-
it_should_behave_like "Allows Destroying"
|
316
|
-
end
|
317
|
-
|
318
|
-
describe "accessed by different member" do
|
319
|
-
before do
|
320
|
-
create_ability_accessed_by_related :member
|
321
|
-
end
|
322
|
-
|
323
|
-
it_should_behave_like "Denies Creating"
|
324
|
-
it_should_behave_like "Allows Reading"
|
325
|
-
it_should_behave_like "Denies Updating"
|
326
|
-
it_should_behave_like "Denies Destroying"
|
327
|
-
end
|
328
|
-
|
329
|
-
describe "accessed by partner" do
|
330
|
-
before do
|
331
|
-
create_ability_accessed_by_related :partner
|
332
|
-
end
|
333
|
-
|
334
|
-
it_should_behave_like "Denies Creating"
|
335
|
-
it_should_behave_like "Denies Reading"
|
336
|
-
it_should_behave_like "Denies Updating"
|
337
|
-
it_should_behave_like "Denies Destroying"
|
338
|
-
end
|
339
|
-
|
340
|
-
describe "accessed publicly" do
|
341
|
-
before do
|
342
|
-
create_ability_accessed_publicly
|
343
|
-
end
|
344
|
-
|
345
|
-
it_should_behave_like "Denies Creating"
|
346
|
-
it_should_behave_like "Denies Reading"
|
347
|
-
it_should_behave_like "Denies Updating"
|
348
|
-
it_should_behave_like "Denies Destroying"
|
349
|
-
end
|
350
|
-
end
|
351
|
-
end
|
352
|
-
end
|
353
|
-
|
354
|
-
|