spec/onstomp/full_stacks/onstomp_spec.rb in onstomp-1.0.8 vs spec/onstomp/full_stacks/onstomp_spec.rb in onstomp-1.0.9
- old
+ new
@@ -93,9 +93,29 @@
client.send '/queue/test', encode_body("hëllo", 'ISO-8859-1')
client.disconnect :receipt => 'rcpt-disconnect'
broker.join
blocked_up.should be_false
end
+
+ it 'should include login/passcode headers that are not empty' do
+ client = OnStomp::Client.new('stomp://localhost:10101', login: 'user', passcode: 'secr3t')
+ client.connect
+ client.disconnect
+ broker.join
+ broker.frames_received.first.command.should == 'CONNECT'
+ broker.frames_received.first.headers['login'].should == 'user'
+ broker.frames_received.first.headers['passcode'].should == 'secr3t'
+ end
+
+ it 'should not include login/passcode headers that are empty' do
+ client = OnStomp::Client.new('stomp://localhost:10101')
+ client.connect
+ client.disconnect
+ broker.join
+ broker.frames_received.first.command.should == 'CONNECT'
+ broker.frames_received.first.headers.set?('login').should == false
+ broker.frames_received.first.headers.set?('passcode').should == false
+ end
it "should block on write" do
blocked_up = false
client = OnStomp::Client.new('stomp://localhost:10101')
client.on_connection_blocked do |*_|