"Let's not" #14
glaucocustodio
started this conversation in
General
Replies: 1 comment 1 reply
-
|
I understand that the 'distance' between the declaration of As an alternative, does this not accomplish the same goal? describe '#full_name' do
context 'when first name and last name are present' do
let(:user) { build(:user, first_name: 'Edson', last_name: 'Pelé') }
it 'returns the full name' do
expect(user.full_name).to eq('Edson Pelé')
end
end
context 'when last name is not present' do
let(:user) { build(:user, first_name: 'Edson', last_name: nil) }
it 'returns the first name' do
expect(user.full_name).to eq('Edson')
end
end
end |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
What are your thoughts on https://evenbetterspecs.github.io/#lets-not?
Beta Was this translation helpful? Give feedback.
All reactions