Skip to content

Commit

Permalink
calculate boundary between binary and payload
Browse files Browse the repository at this point in the history
  • Loading branch information
niku committed Apr 20, 2012
1 parent ccf77c3 commit f0699bd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions spec/apn_on_rails/app/models/apn/notification_spec.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@
noty.message_for_sending noty.message_for_sending
} }
let(:token) { '5gxadhy6 6zmtxfl6 5zpbcxmw ez3w7ksf qscpr55t trknkzap 7yyt45sc g6jrw7qz' } 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 it do
subject.should == fixture_value('message_for_sending.bin') subject.should == fixture_value('message_for_sending.bin')
Expand Down

0 comments on commit f0699bd

Please sign in to comment.