Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
...
context 'Scopes' do
it 'gets a conversation between users' do
user1 = create(:user)
user2 = create(:user)
create(:private_conversation, recipient_id: user1.id, sender_id: user2.id)
conversation = Private::Conversation.between_users(user1.id, user2.id)
expect(conversation.count).to eq 1
end
end
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment