Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# Used to modify the relationship tags applied to the specified contact
#
# PUT /users/bob/contacts/alice/tags?friend=t&family=f
#
# Sets the tags on the relationship that 'bob' has with 'alice' to be 'friend' and not 'family'
#
def tags
@contact = user.contacts.with_login( params[:id] )
@relationship = user.relationships.with( @contact )
@relationship.set( tags_from_params( params ) )
end
it "PUT #tags (html) should tag a contact as a friend" do
u1, u2 = User.generate, User.generate
r = u1.add_contact( u2 )
r.should_receive( :set ).with( :friend => true )
put :tags, :user_id => u2.login, :id => u1.login, :friend => 't'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment