Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

calculate boundary between binary and payload

  • Loading branch information...
commit f0699bd143c77fc15b6a2b53c9421805fbefdcfe 1 parent ccf77c3
niku authored
Showing with 4 additions and 0 deletions.
  1. +4 −0 spec/apn_on_rails/app/models/apn/notification_spec.rb
4 spec/apn_on_rails/app/models/apn/notification_spec.rb
View
@@ -50,6 +50,10 @@
noty.message_for_sending
}
let(:token) { '5gxadhy6 6zmtxfl6 5zpbcxmw ez3w7ksf qscpr55t trknkzap 7yyt45sc g6jrw7qz' }
+ let(:device_token_binary_size) { [token.delete(' ')].pack('H*').size }
+ let(:token_part_header_length) { 1 + 2 } # Command length(1 byte) + Token length(2 byte)
+ let(:payload_part_header_length) { 2 } # Payload length(2 byte)
+ let(:boundaly_between_binary_and_payload) { token_part_header_length + device_token_binary_size + payload_part_header_length }
it do
subject.should == fixture_value('message_for_sending.bin')
Please sign in to comment.
Something went wrong with that request. Please try again.