hostelify 0.4.6 → 0.4.7
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.
- data/Manifest +0 -1
 - data/Rakefile +1 -1
 - data/hostelify.gemspec +1 -1
 - data/lib/hostelify/hostelbookers.rb +4 -4
 - data/spec/hb_find_by_hostel.spec +3 -3
 - metadata +2 -2
 
    
        data/Manifest
    CHANGED
    
    
    
        data/Rakefile
    CHANGED
    
    
    
        data/hostelify.gemspec
    CHANGED
    
    
| 
         @@ -95,10 +95,10 @@ class Hostelbookers 
     | 
|
| 
       95 
95 
     | 
    
         
             
                if available
         
     | 
| 
       96 
96 
     | 
    
         
             
                  (available/"tr").each do |row|
         
     | 
| 
       97 
97 
     | 
    
         
             
                    name = row.at("td.roomType/label/text()")
         
     | 
| 
       98 
     | 
    
         
            -
                     
     | 
| 
       99 
     | 
    
         
            -
                    people =  
     | 
| 
       100 
     | 
    
         
            -
                     
     | 
| 
       101 
     | 
    
         
            -
                    price =  
     | 
| 
      
 98 
     | 
    
         
            +
                    people = row.at("td.people/select")
         
     | 
| 
      
 99 
     | 
    
         
            +
                    people = people.at("option:last-child").inner_text unless people.nil?
         
     | 
| 
      
 100 
     | 
    
         
            +
                    price = row.at("td.price")
         
     | 
| 
      
 101 
     | 
    
         
            +
                    price = price.inner_text.to_s.match(/[\d.]{1,5}/)[0] unless price.nil?
         
     | 
| 
       102 
102 
     | 
    
         
             
                    (0..(options[:no_days].to_i-1)).each do |x|
         
     | 
| 
       103 
103 
     | 
    
         
             
                      @availables << HostelifyAvailable.new(name,price,people,(date+x).to_s) unless price.nil?
         
     | 
| 
       104 
104 
     | 
    
         
             
                    end
         
     | 
    
        data/spec/hb_find_by_hostel.spec
    CHANGED
    
    | 
         @@ -35,7 +35,7 @@ end 
     | 
|
| 
       35 
35 
     | 
    
         | 
| 
       36 
36 
     | 
    
         
             
            describe "all options" do
         
     | 
| 
       37 
37 
     | 
    
         
             
              before(:all) do
         
     | 
| 
       38 
     | 
    
         
            -
                @h = Hostelbookers.find_hostel_by_id(: 
     | 
| 
      
 38 
     | 
    
         
            +
                @h = Hostelbookers.find_hostel_by_id(:id => 9330, :all => true)
         
     | 
| 
       39 
39 
     | 
    
         
             
              end
         
     | 
| 
       40 
40 
     | 
    
         | 
| 
       41 
41 
     | 
    
         
             
              it "directions should have a certain length <" do
         
     | 
| 
         @@ -49,7 +49,7 @@ end 
     | 
|
| 
       49 
49 
     | 
    
         | 
| 
       50 
50 
     | 
    
         
             
            describe "with dates to get availabilty and verify output!" do
         
     | 
| 
       51 
51 
     | 
    
         
             
              before(:all) do
         
     | 
| 
       52 
     | 
    
         
            -
                @h = Hostelbookers.find_hostel_by_id(: 
     | 
| 
      
 52 
     | 
    
         
            +
                @h = Hostelbookers.find_hostel_by_id(:id => 19831, :date => (Date.today+10).to_s)
         
     | 
| 
       53 
53 
     | 
    
         
             
              end
         
     | 
| 
       54 
54 
     | 
    
         | 
| 
       55 
55 
     | 
    
         
             
              it "get first availability and check it merit" do
         
     | 
| 
         @@ -57,7 +57,7 @@ describe "with dates to get availabilty and verify output!" do 
     | 
|
| 
       57 
57 
     | 
    
         
             
              end
         
     | 
| 
       58 
58 
     | 
    
         | 
| 
       59 
59 
     | 
    
         
             
              it "check number of avail beds" do
         
     | 
| 
       60 
     | 
    
         
            -
                @h.availability.first.spots.to_i.should be  
     | 
| 
      
 60 
     | 
    
         
            +
                @h.availability.first.spots.to_i.should be >= 1
         
     | 
| 
       61 
61 
     | 
    
         
             
              end
         
     | 
| 
       62 
62 
     | 
    
         | 
| 
       63 
63 
     | 
    
         
             
              it "last avail has a price > 5 US" do
         
     |