Skip to content

Instantly share code, notes, and snippets.

@davidlee
Created December 2, 2009 23:33
Show Gist options
  • Save davidlee/247722 to your computer and use it in GitHub Desktop.
Save davidlee/247722 to your computer and use it in GitHub Desktop.
context 'unauthorized' do
it "ACK an attempt to CONNECT" do
result = json_request :command => 'CONNECT', :message_id => 'antarctica'
result['command'].should == "ACK"
result['message_id'].should == "antarctica"
end
it "send an ERROR for any message which is not a CONNECT" do
result = json_request :command => 'SHOWTABLES', :message_id => 'snoo', :location => 'wibble'
result['command'].should == "ERROR"
result['error_code'].should == 'NOT_AUTHORIZED'
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment