Open
Conversation
…nitialize method
…te the make_reservation method accordingly
HotelWhat We're Looking For
|
CheezItMan
reviewed
Sep 17, 2018
lib/admin.rb
Outdated
| end | ||
|
|
||
| # make new reservations | ||
| def make_reservation(reservation_id, customer_name, start_date, end_date) |
There was a problem hiding this comment.
Why do you need a reservation_id to make a reservation?
|
|
||
| # input a string of date, to return the list of the reservations on that date | ||
| def list_reservations(date_selected) | ||
| return @reservations.select {|reserve| reserve.dates_booked.include? date_selected} |
lib/block_admin.rb
Outdated
| require_relative 'room' | ||
| require_relative 'admin' | ||
|
|
||
| class Block < Admin |
There was a problem hiding this comment.
Is a Block and Admin? Why make it a subclass?
lib/main.rb
Outdated
| @@ -0,0 +1,19 @@ | |||
| require 'pry' | |||
There was a problem hiding this comment.
This file is unnecessary in the project.
|
|
||
| it "will not create a reservation if no room is available" do | ||
|
|
||
| expect(@admin_1.reservations.length).must_equal 22 |
There was a problem hiding this comment.
This test isn't trying to create a reservation
|
|
||
| end | ||
|
|
||
| it "returns nil if no result being found" do |
|
|
||
| it "if result being found, must return an array of resrvations " do | ||
| expect(@admin_1.list_reservations(Date.new(2018,12,5))).must_include @res_1 | ||
| expect(@admin_1.list_reservations(Date.new(2018,12,5))).must_include @res_2 |
There was a problem hiding this comment.
You should also verify that they're all reservations.
…from the parameters to generate new reservation instance
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hotel
Congratulations! You're submitting your assignment!
Comprehension Questions