-
Notifications
You must be signed in to change notification settings - Fork 257
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Joseph Bloom #603
base: main
Are you sure you want to change the base?
Joseph Bloom #603
Conversation
git push git status
Iteration 1 branch 1
Iteration2branch2
Iteration3branch3
iteration 3 looking good. new dmv_facilities class and accompanying s…
iteration 4 begins
Iteration4branch4
Merge pull request #6 from Jsphbloom/iteration4branch4
spec tests looking nice on dmv_facilities_spec
require './lib/dmv_data_service' | ||
|
||
|
||
class DmvFacilities |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it might make more sense to call this class DMVFactory
to match the Vehicle Factory naming convention
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree ^
|
||
def administer_written_test(registrant) | ||
if @services.include?("Written Test") && registrant.permit? == true | ||
registrant.license_data[:written] = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This definitely works, but it would be a little better if there was a method on the registrant class that managed this change. It could either be explicitly exposing license_data
as an attr_writer or attr_accessor, or you could create a method to earn_written_license
that would change the value from inside the registrant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense! i thought it was a little weird that I was handling this from facility.
@address = address | ||
@phone = phone | ||
def initialize(facility_details) | ||
@name = facility_details[:name] || facility_details[:dmv_office] || facility_details[:office_name] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice use of this OR logic 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you B)
describe '#register vehicle' do | ||
it 'can register a vehicle' do | ||
@facility.register_vehicle(@cruz) | ||
expect(@facility.registered_vehicles).to eq([@cruz]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You also want to make sure that the registration date is set when this method is called!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes gotcha! Missed that!
No description provided.