Open
Conversation
… for view vacant room broke
…utside a block cannot reserve a block
HotelWhat We're Looking For
|
CheezItMan
reviewed
Sep 17, 2018
| range = create_hotel_range(start_date, end_date) # for hotel | ||
| e_date = end_date - 1 # rooms do not keep track of last night | ||
| vacant_rooms = view_vacant_rooms(start_date, e_date) | ||
| if vacant_rooms.nil? |
There was a problem hiding this comment.
Shouldn't this method instead return an empty array if there are no rooms available?
| return dates | ||
| end | ||
|
|
||
| private |
There was a problem hiding this comment.
Good that you're using private methods.
| expect(@admin.rooms.first.ranges). must_equal range | ||
| end | ||
|
|
||
| it "no rooms available for 20 reservations" do |
| info[:range] = range | ||
| @admin.reserve_room_in_block(info) | ||
| rooms = @admin.view_vacant_rooms_in_block(range) | ||
| expect(rooms.length).must_equal 3 |
There was a problem hiding this comment.
You should also check for specific rooms available in the block
| expect(rooms.length).must_equal 3 | ||
| end | ||
|
|
||
| it "an outsider of a party can't reserve a room in a block" do |
There was a problem hiding this comment.
You should also test what happens if you reserve more rooms than are in the block.
| @@ -0,0 +1,15 @@ | |||
| require_relative 'spec_helper' | |||
|
|
|||
| describe "#Room - initialize method" do | |||
There was a problem hiding this comment.
You also need methods testing the tracking of Reservations and Blocks.
…erve a room in a block
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