Skip to content

Commit

Permalink
Merge 29c4e90 into c0316b5
Browse files Browse the repository at this point in the history
  • Loading branch information
ZHENG-JING-JZ committed Feb 20, 2020
2 parents c0316b5 + 29c4e90 commit aba7263
Show file tree
Hide file tree
Showing 7 changed files with 206 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).
This changelog adheres to [Keep a CHANGELOG](http://keepachangelog.com/).

## [Unreleased]
### Added
- [DC-2942] Add package class to support quantity based package

## [3.8.1]
### Changed
- [DC-3033] Reverse changes in checkout class to fix polipay redirection in EcomEngine
Expand Down
1 change: 1 addition & 0 deletions lib/quick_travel.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ module QuickTravel
require 'quick_travel/drop_off_location'
require 'quick_travel/drop_off_option'
require 'quick_travel/location'
require 'quick_travel/package'
require 'quick_travel/party'
require 'quick_travel/passenger'
require 'quick_travel/passenger_type'
Expand Down
13 changes: 13 additions & 0 deletions lib/quick_travel/package.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
require 'quick_travel/adapter'

module QuickTravel
class Package < Adapter
attr_reader :error_message

self.api_base = '/api/packages'

def product_type
QuickTravel::ProductType.find(product_type_id)
end
end
end
24 changes: 24 additions & 0 deletions spec/package_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
require 'spec_helper'
require 'quick_travel/package'

describe QuickTravel::Package do
subject(:package) {
VCR.use_cassette('package_show') do
QuickTravel::Package.find(464)
end
}

its(:name) { should eq 'Swan Valley Gourmet Wine Cruise (SVGWC-0945)' }
its(:type) { should eq 'Package' }


context '#product_type' do
subject(:property_type) {
VCR.use_cassette 'package_show_product_type' do
package.product_type
end
}

its(:name) { should eq 'Rottnest Packages' }
end
end
83 changes: 83 additions & 0 deletions spec/support/cassettes/package_show.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

80 changes: 80 additions & 0 deletions spec/support/cassettes/package_show_product_type.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion spec/support/coverage_loader.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require 'simplecov-rcov'
require 'coveralls'
require 'coverage/kit'
Coverage::Kit.setup(minimum_coverage: 83)
Coverage::Kit.setup(minimum_coverage: 83.2)

0 comments on commit aba7263

Please sign in to comment.