Guest User

Untitled

a guest
Feb 2nd, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. def add_two(a, b)
  2. a.to_i + b.to_i
  3. end
  4.  
  5.  
  6. add_two(1, 1)
  7.  
  8.  
  9. describe '#add_two' do
  10. context 'when I add two positive numbers' do
  11. it 'returns the sum of the numbers' do
  12. expect(add_two(1, 1)).to eq(2)
  13. end
  14. end
  15.  
  16. context 'when the inputs are strings' do
  17. it 'returns the sum of the numbers as if they were integers' do
  18. expect(add_two('1', '1')).to eq(2)
  19. end
  20. end
  21. end
  22.  
  23.  
  24. describe UsersController do
  25. context 'when the params are valid' do
  26. it 'create the user' do
  27. post user: { name: 'eduardo', email: 'eduardo@gmakil.com', password: 'password', age: 18}
  28. expect(User.count).to eq(1)
  29. end
  30.  
  31. it 'redirects to the homepage' do
  32.  
  33. end
  34. end
  35. end
Add Comment
Please, Sign In to add comment