Created
February 1, 2019 04:05
-
-
Save eduardopoleo/44097f3a6ec44e9069c027dcb4841aec to your computer and use it in GitHub Desktop.
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
def add_two(a, b) | |
a.to_i + b.to_i | |
end | |
add_two(1, 1) | |
describe '#add_two' do | |
context 'when I add two positive numbers' do | |
it 'returns the sum of the numbers' do | |
expect(add_two(1, 1)).to eq(2) | |
end | |
end | |
context 'when the inputs are strings' do | |
it 'returns the sum of the numbers as if they were integers' do | |
expect(add_two('1', '1')).to eq(2) | |
end | |
end | |
end | |
describe UsersController do | |
context 'when the params are valid' do | |
it 'create the user' do | |
post user: { name: 'eduardo', email: 'eduardo@gmakil.com', password: 'password', age: 18} | |
expect(User.count).to eq(1) | |
end | |
it 'redirects to the homepage' do | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment