Permalink
Browse files

Fix: follower notifications are sent to /posts

  • Loading branch information...
1 parent 953b8c3 commit df1000b8002bf4c235f0582afc4e11d1dd3c824b Jesse Stuart committed Nov 16, 2012
Showing with 6 additions and 2 deletions.
  1. +5 −1 lib/tentd/api/posts.rb
  2. +1 −1 spec/integration/api/posts_spec.rb
View
@@ -111,7 +111,11 @@ def action(env)
end
post.assign_permissions(env.params.data.permissions) if post.original
env['response'] = post
- env
+ if env.current_auth.kind_of?(Model::Follower) && auth_is_publisher?(env.current_auth, post)
+ TriggerUpdates.new(@app).call(env)
+ else
+ env
+ end
end
private
@@ -801,7 +801,7 @@ def authorize!(*scopes)
it 'should trigger a entity update' do
env['current_auth'] = follower
TentD::Model::Follower.expects(:update_entity).with(follower.id)
- json_post "/notifications/#{follower.public_id}", post_attributes, env
+ json_post "/posts", post_attributes, env
expect(last_response.status).to eq(200)
end
end

0 comments on commit df1000b

Please sign in to comment.