Conversation
| human = Human.new('Garfield') | ||
| human.age = 18 | ||
| expect(human.can_drink? 'Australia').to be true | ||
| expect(human.can_drink? 'United States').to be false |
There was a problem hiding this comment.
can you add a test to see what happens when we use an address that does not match one in our list
specs/models/human_spec.rb
Outdated
| human = Human.new('Boris Jr') | ||
| human.age = 14 | ||
| expect(human.can_drink?).to be false | ||
|
|
There was a problem hiding this comment.
try not to leave blank lines between the end
| end | ||
| end | ||
|
|
||
| describe '.can_drink?' do |
There was a problem hiding this comment.
great work that you put all the expectations inside of one describe block
models/human.rb
Outdated
| end | ||
|
|
||
|
|
||
| AGES = { |
There was a problem hiding this comment.
great foresight here... Only small suggestion, this would be better to put in another file (or in Rails we would of had it in a DB table) to reduce the noise in the model
In this case it might be better to make this another class that you can ask for drinking_ages (as per comment below in specs). We can discuss this further next week
| human.age = 18 | ||
| expect(human.can_drink? 'Australia').to be true | ||
| expect(human.can_drink? 'United States').to be false | ||
| end |
There was a problem hiding this comment.
can you add another test and not set age and see what happens
No description provided.