Last active
September 14, 2020 21:26
-
-
Save CalyCherkaoui/784852953713364102fb2fefc00d13c0 to your computer and use it in GitHub Desktop.
Some usefull snippets for Rails
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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