Skip to content

Instantly share code, notes, and snippets.

@stevo
Created May 8, 2018 09:29
Show Gist options
  • Save stevo/7c5270a244a476cb6be723c2e226e989 to your computer and use it in GitHub Desktop.
Save stevo/7c5270a244a476cb6be723c2e226e989 to your computer and use it in GitHub Desktop.
An opinionated guide to readable RSpec (part 2 of 2)
stub_request(:get, 'https://hotels.cloudbeds.com/api/v1.1/getRoomTypes') { {
body:
{
'success' => true,
'data' => [
{
'roomTypeID' => '713',
'propertyID' => '276',
'roomTypeName' => 'AAA',
'roomTypeNameShort' => 'AAA',
'roomTypeDescription' => 'asdfa',
'isPrivate' => false,
'maxGuests' => '1',
'adultsIncluded' => '1',
'childrenIncluded' => 0,
'roomsAvailable' => 3,
'roomRate' => 120,
'roomTypeUnits' => 10
}
],
'count' => 1,
'total' => 1
}.to_json
} }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment