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 27, 2012
1 parent a46b5c9 commit 5c6de67
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 Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit 5c6de67

Please sign in to comment.