Skip to content

Instantly share code, notes, and snippets.

@hayduke19us
Created December 28, 2015 21:57
Show Gist options
  • Save hayduke19us/2aef8014a79237070124 to your computer and use it in GitHub Desktop.
Save hayduke19us/2aef8014a79237070124 to your computer and use it in GitHub Desktop.
Fastlift::FuturePromotion ........FF..FFFF
1) Fastlift::FuturePromotion.find next promotion's id for the first unit when the promo's booking hasn't started today should == 1
Failure/Error: it { should == promotions.first.id }
expected: 1
got: nil (using ==)
# ./spec/models/fastlift/future_promotion_spec.rb:77:in `block (5 levels) in <module:Fastlift>'
2) Fastlift::FuturePromotion.find next promotion's id for the first unit when the promo's booking has ended for today should == 1
Failure/Error: it { should == promotions.first.id }
expected: 1
got: nil (using ==)
# ./spec/models/fastlift/future_promotion_spec.rb:86:in `block (5 levels) in <module:Fastlift>'
3) Fastlift::FuturePromotion.find starts at when the promo's booking hasn't started today
Failure/Error: subject { FuturePromotion.rb_find([units.first.id], Time.now.utc.to_s(:db), check_in.to_s(:db), nights, db_config)[units.first.id].starts_at.to_json }
NoMethodError:
undefined method `starts_at' for nil:NilClass
# ./spec/models/fastlift/future_promotion_spec.rb:96:in `block (4 levels) in <module:Fastlift>'
# ./spec/models/fastlift/future_promotion_spec.rb:110:in `block (5 levels) in <module:Fastlift>'
4) Fastlift::FuturePromotion.find starts at when the promo starts after today and has a daily window should == "\"2012-01-03T14:00:00Z\""
Failure/Error: it { should == Time.use_zone('Madrid'){Time.zone.local(2012,1,3,15)}.utc.to_json }
expected: "\"2012-01-03T14:00:00Z\""
got: "\"2012-01-03T11:00:00Z\"" (using ==)
# ./spec/models/fastlift/future_promotion_spec.rb:118:in `block (5 levels) in <module:Fastlift>'
5) Fastlift::FuturePromotion.find starts at when the promo's booking has ended for today
Failure/Error: subject { FuturePromotion.rb_find([units.first.id], Time.now.utc.to_s(:db), check_in.to_s(:db), nights, db_config)[units.first.id].starts_at.to_json }
NoMethodError:
undefined method `starts_at' for nil:NilClass
# ./spec/models/fastlift/future_promotion_spec.rb:96:in `block (4 levels) in <module:Fastlift>'
# ./spec/models/fastlift/future_promotion_spec.rb:126:in `block (5 levels) in <module:Fastlift>'
6) Fastlift::FuturePromotion.find starts at when the promo starts today earlier than its daily window starts should == "\"2012-01-01T14:00:00Z\""
Failure/Error: it { should == Time.use_zone('Madrid'){Time.zone.local(2012,1,1,15)}.utc.to_json }
expected: "\"2012-01-01T14:00:00Z\""
got: "\"2012-01-01T08:00:00Z\"" (using ==)
# ./spec/models/fastlift/future_promotion_spec.rb:135:in `block (5 levels) in <module:Fastlift>'
Finished in 5.69 seconds
16 examples, 6 failures
Failed examples:
rspec ./spec/models/fastlift/future_promotion_spec.rb:77 # Fastlift::FuturePromotion.find next promotion's id for the first unit when the promo's booking hasn't started today should == 1
rspec ./spec/models/fastlift/future_promotion_spec.rb:86 # Fastlift::FuturePromotion.find next promotion's id for the first unit when the promo's booking has ended for today should == 1
rspec ./spec/models/fastlift/future_promotion_spec.rb:110 # Fastlift::FuturePromotion.find starts at when the promo's booking hasn't started today
rspec ./spec/models/fastlift/future_promotion_spec.rb:118 # Fastlift::FuturePromotion.find starts at when the promo starts after today and has a daily window should == "\"2012-01-03T14:00:00Z\""
rspec ./spec/models/fastlift/future_promotion_spec.rb:126 # Fastlift::FuturePromotion.find starts at when the promo's booking has ended for today
rspec ./spec/models/fastlift/future_promotion_spec.rb:135 # Fastlift::FuturePromotion.find starts at when the promo starts today earlier than its
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment