suitcase 1.3.1 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,63 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Suitcase::Room do
4
- before :all do
5
- @room = Suitcase::Hotel.find(id: 123904).rooms(arrival: "6/23/2012", departure: "6/30/2012").first
6
- end
7
-
8
- subject { @room }
9
- it { should respond_to :reserve! }
10
- it { should respond_to :arrival }
11
- it { should respond_to :departure }
12
- it { should respond_to :rate_code }
13
- it { should respond_to :room_type_code }
14
- it { should respond_to :supplier_type }
15
- it { should respond_to :tax_rate }
16
- it { should respond_to :non_refundable }
17
- it { should respond_to :occupancy }
18
- it { should respond_to :quoted_occupancy }
19
- it { should respond_to :min_guest_age }
20
- it { should respond_to :total }
21
- it { should respond_to :surcharge_total }
22
- it { should respond_to :nightly_rate_total }
23
- it { should respond_to :average_base_rate }
24
- it { should respond_to :average_rate }
25
- it { should respond_to :max_nightly_rate }
26
- it { should respond_to :currency_code }
27
- it { should respond_to :value_adds }
28
- it { should respond_to :room_type_description }
29
- it { should respond_to :price_breakdown }
30
- it { should respond_to :total_price }
31
- it { should respond_to :average_nightly_rate }
32
- it { should respond_to :promo }
33
- it { should respond_to :rate_key }
34
- it { should respond_to :hotel_id }
35
- it { should respond_to :supplier_type }
36
- it { should respond_to :bed_types }
37
-
38
- describe "#reserve!" do
39
- before :all do
40
- @info = { email: "walter.john.nelson@gmail.com",
41
- first_name: "Walter",
42
- last_name: "Nelson",
43
- home_phone: "3831039402",
44
- payment_option: Keys::SUITCASE_PAYMENT_OPTION, # Visa
45
- credit_card_number: Keys::CREDIT_CARD_NUMBER_TESTING,
46
- credit_card_verification_code: Keys::CREDIT_CARD_CVV_TESTING, # CVV
47
- credit_card_expiration_date: Keys::CREDIT_CARD_EXPIRATION_DATE_TESTING,
48
- address1: "travelnow", # for testing
49
- address2: "Apt. 4A",
50
- city: "Boston",
51
- province: "MA",
52
- country: "US",
53
- postal_code: "02111" }
54
- @room.rooms[0][:bed_type] = @room.bed_types[0]
55
- @room.rooms[0][:smoking_preference] = "NS"
56
- end
57
-
58
- it "should respond to a Hash of arguments" do
59
- reservation = @room.reserve!(@info)
60
- reservation.should be_a(Suitcase::Reservation)
61
- end
62
- end
63
- end
@@ -1,43 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Suitcase::Session do
4
- it { should respond_to :id }
5
- it { should respond_to :ip_address }
6
- it { should respond_to :user_agent }
7
- it { should respond_to :locale }
8
- it { should respond_to :currency_code }
9
-
10
- before :each do
11
- @s = Suitcase::Session.new
12
- end
13
-
14
- it "should be able to be passed in to a Hotel.find_by_id query" do
15
- Suitcase::Hotel.find(id: 123904, session: @s)
16
- @s.id.should_not be_nil
17
- end
18
-
19
- it "should be able to be passed in to a Hotel.find_by_info query" do
20
- Suitcase::Hotel.find(location: "Boston, US", session: @s)
21
- @s.id.should_not be_nil
22
- end
23
-
24
- it "should be able to be passed in to a Hotel#rooms query" do
25
- hotel = Suitcase::Hotel.find(id: 123904, session: @s)
26
- hotel.rooms(arrival: "6/23/2012", departure: "6/25/2012", session: @s)
27
- @s.id.should_not be_nil
28
- end
29
-
30
- it "should be able to be passed in to a Room#reserve! query" do
31
- hotel = Suitcase::Hotel.find(id: 123904, session: @s)
32
- room = hotel.rooms(arrival: "6/23/2012", departure: "6/25/2012", session: @s).first
33
- room.rooms[0][:bed_type] = room.bed_types[0]
34
- room.rooms[0][:smoking_preference] = "NS"
35
- room.reserve! Keys::VALID_RESERVATION_INFO
36
- @s.id.should_not be_nil
37
- end
38
-
39
- it "should be able to be passed in to a PaymentOption.find query" do
40
- payment_options = Suitcase::PaymentOption.find(currency_code: "USD", session: @s)
41
- @s.id.should_not be_nil
42
- end
43
- end
data/spec/spec_helper.rb DELETED
@@ -1,3 +0,0 @@
1
- require File.dirname(__FILE__) + '/../lib/suitcase'
2
- require 'keys'
3
- require 'pry'