Skip to content
Browse files

added tzinfo gem

fixed specs
  • Loading branch information...
1 parent d3a3273 commit d16c9df9b1945b50f6fe9454924b6a57d8bbb83a @alextk committed Apr 28, 2012
Showing with 5 additions and 2 deletions.
  1. +1 −0 Gemfile
  2. +2 −0 Gemfile.lock
  3. +1 −1 lib/smsim/delivery_notifications_parser.rb
  4. +1 −1 spec/smsim/delivery_notifications_parser_spec.rb
View
1 Gemfile
@@ -7,6 +7,7 @@ gem 'nokogiri'
gem 'uuidtools'
gem 'logging'
gem 'activesupport'
+gem 'tzinfo' # for timezones support
gem 'i18n'
# Add dependencies to develop your gem here.
View
2 Gemfile.lock
@@ -51,6 +51,7 @@ GEM
nokogiri (>= 1.4.0)
nori (~> 1.1)
wasabi (~> 2.1)
+ tzinfo (0.3.32)
uuidtools (2.1.2)
wasabi (2.1.0)
nokogiri (>= 1.4.0)
@@ -74,5 +75,6 @@ DEPENDENCIES
rdoc (~> 3.12)
rspec (= 2.7.0)
savon
+ tzinfo
uuidtools
webmock
View
2 lib/smsim/delivery_notifications_parser.rb
@@ -13,7 +13,7 @@ def self.logger
# "CustomerMessageId"=>"18825cc0-6a2d-11e1-903f-70cd60fffee5", "BillingCodeId"=>"1", "id"=>"", "Network"=>"054", "CustomerParam"=>"",
# "NotificationDate"=>"09/03/2012 23:16:04", "ActionType"=>"Content", "Price"=>"0.00"}
def self.http_push(params)
- ['PhoneNumber', 'Status', 'CustomerMessageId', 'SegmentsNumber', 'NotificationDate'].each do |p|
+ %w(PhoneNumber Status CustomerMessageId SegmentsNumber NotificationDate).each do |p|
raise Smsim::Errors::GatewayError.new(301, "Missing http parameter #{p}. Parameters were: #{params.inspect}") if params[p].blank?
end
logger.debug "Parsing http push delivery notification params: #{params.inspect}"
View
2 spec/smsim/delivery_notifications_parser_spec.rb
@@ -21,7 +21,7 @@
it 'should return DeliveryNotification with all fields initialized' do
notification.should be_present
notification.message_id.should == 'a1'
- notification.phone.should == '0545123456'
+ notification.phone.should == '972545123456'
notification.gateway_status.should be_a(Integer)
notification.gateway_status.should == 1
notification.parts_count.should be_a(Integer)

0 comments on commit d16c9df

Please sign in to comment.
Something went wrong with that request. Please try again.