Skip to content

Instantly share code, notes, and snippets.

@CalyCherkaoui
Last active September 14, 2020 21:26
Show Gist options
  • Save CalyCherkaoui/784852953713364102fb2fefc00d13c0 to your computer and use it in GitHub Desktop.
Save CalyCherkaoui/784852953713364102fb2fefc00d13c0 to your computer and use it in GitHub Desktop.
Some usefull snippets for Rails
# How to create many instances for tests
context 'Friendship relations' do
# populating users for test
let (:params) { {name: 'usertest', email: '[email protected]', password: 'foobar', password_confirmation: 'foobar'} }
before(:each) do
User.new(params).save
User.new(params).save
User.new(params.merge(gravatar_url: 'mygravatar')).save
end
it 'should return friend to whom user send a friendship request' do
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment