Created
January 23, 2020 11:31
-
-
Save roberson-miguel/16e57cc0390f22f0be6cd726b60a1740 to your computer and use it in GitHub Desktop.
Teste de uso! WIP
This file contains 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
Boa noite galera, eu e a @Larissa Porto fizemos um teste para assegurar que o patch não criou um objeto novo no banco, segue o código: | |
it 'should not create another car' do | |
car = create(:car, license_plate:'ABC-0987') | |
expect{ | |
patch api_v1_car_path(car), params: {license_plate: 'DEF-1234'} | |
}.to change(Car, :count).by(0) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment