Skip to content
This repository has been archived by the owner on Feb 16, 2018. It is now read-only.

Commit

Permalink
Fix: follower notifications are sent to /posts
Browse files Browse the repository at this point in the history
  • Loading branch information
Jesse Stuart committed Nov 16, 2012
1 parent 953b8c3 commit df1000b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion lib/tentd/api/posts.rb
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spec/integration/api/posts_spec.rb
Expand Up @@ -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
Expand Down

0 comments on commit df1000b

Please sign in to comment.