Conversation
…me it was called.
…d for the time being.
HotelSection 1: Major Learning Goals
Section 2: Code Review and Testing Requirements
Section 3: Feature Requirements
Overall Feedback
Additional FeedbackGreat work overall! You've built your first project with minimal starting code. This represents an incredible milestone in your journey, and you should be proud of yourself! I am particularly impressed by the way that you wrote multiple methods in the Room class to deal with the difficult task of creating a block. You clearly spent time considering different design options, and worked through some tricky logic. In addition, the thoroughness of your unit tests are quite impressive. I've left a few inline comments for you to review, mainly focused on ways you might consider refactoring your tests. These notes are minor. This is an impressive project. Keep up the hard work! Code Style Bonus AwardsWas the code particularly impressive in code style for any of these reasons (or more...?)
|
|
|
||
| @date_range = DateRange.new(start_date: start_date, end_date: end_date) | ||
| @room_id = room_id | ||
| @rate = (rate == :default) ? 200 : rate |
There was a problem hiding this comment.
Nice use of a ternary, and an optional keyword argument
| end | ||
|
|
||
| it "returns true if the dates overlap and false if not" do | ||
| # TODO: each one should be a new test? |
There was a problem hiding this comment.
Since each other this expects are testing a different way that dates could overlap, it would be good to put each of these assertions in their own it block that describes exactly what you are testing.
| end | ||
|
|
||
| describe "rooms" do | ||
| it "returns an array" do |
There was a problem hiding this comment.
these two it blocks (returns and array and returns an array of Rooms) could be included in a single it block
| end | ||
| end | ||
|
|
||
| describe "find_reservations" do |
There was a problem hiding this comment.
These tests are quite thorough. Nice work! Make sure to also include a test for an edge case such as no reservations for a given date range.
| expect(@reservation_desk.rooms[2].available?(start_date: "2020-3-1", end_date: "2020-3-5")).must_equal false | ||
| end | ||
|
|
||
| it "No ID provided: raises an Exception if no rooms are available for requested dates" do |
There was a problem hiding this comment.
Great test of an edge case. Minor note: Consider making a custom exception for this situation.
| end | ||
|
|
||
| describe "cost" do | ||
| it "returns an integer" do |
There was a problem hiding this comment.
These two it blocks could be combined into one.
Assignment Submission: Hotel
Congratulations! You're submitting your assignment. Please reflect on the assignment with these questions.
Reflection