File tree Expand file tree Collapse file tree 4 files changed +15
-15
lines changed
Expand file tree Collapse file tree 4 files changed +15
-15
lines changed Original file line number Diff line number Diff line change 3434 client . connection . once ( :failed ) do
3535 expect ( custom_logger_object . logs . find do |severity , message |
3636 next unless %w( fatal error ) . include? ( severity . to_s )
37- message . match ( %r{https://help.ably.io/error/40400 } )
37+ message . match ( %r{https://help.ably.io/error/40101 } )
3838 end ) . to_not be_nil
3939 stop_reactor
4040 end
Original file line number Diff line number Diff line change 3131 error = connection_state_change . reason
3232 expect ( connection . state ) . to eq ( :failed )
3333 # TODO: Check error type is an InvalidToken exception
34- expect ( error . status ) . to eq ( 404 )
35- expect ( error . code ) . to eq ( 40400 ) # not found
34+ expect ( error . status ) . to eq ( 401 )
35+ expect ( error . code ) . to eq ( 40101 ) # not found
3636 stop_reactor
3737 end
3838 end
4646 error = connection_state_change . reason
4747 expect ( connection . state ) . to eq ( :failed )
4848 # TODO: Check error type is a TokenNotFound exception
49- expect ( error . status ) . to eq ( 401 )
49+ expect ( error . status ) . to eq ( 404 )
5050 expect ( error . code ) . to eq ( 40400 ) # not found
5151 stop_reactor
5252 end
@@ -1396,10 +1396,10 @@ def kill_connection_transport_and_prevent_valid_resume
13961396 channel = client . channels . get ( "foo" )
13971397 channel . attach do
13981398 connection . once ( :failed ) do |state_change |
1399- expect ( state_change . reason . code ) . to eql ( 40400 )
1400- expect ( connection . error_reason . code ) . to eql ( 40400 )
1399+ expect ( state_change . reason . code ) . to eql ( 40101 )
1400+ expect ( connection . error_reason . code ) . to eql ( 40101 )
14011401 expect ( channel ) . to be_failed
1402- expect ( channel . error_reason . code ) . to eql ( 40400 )
1402+ expect ( channel . error_reason . code ) . to eql ( 40101 )
14031403 stop_reactor
14041404 end
14051405
Original file line number Diff line number Diff line change 7272
7373 describe 'failed requests' do
7474 context 'due to invalid Auth' do
75- it 'should raise an InvalidRequest exception with a valid error message and code' do
75+ it 'should raise an UnauthorizedRequest exception with a valid error message and code' do
7676 invalid_client = Ably ::Rest ::Client . new ( key : 'appid.keyuid:keysecret' , environment : environment )
7777 expect { invalid_client . channel ( 'test' ) . publish ( 'foo' , 'choo' ) } . to raise_error do |error |
78- expect ( error ) . to be_a ( Ably ::Exceptions ::ResourceMissing )
79- expect ( error . message ) . to match ( /No application found / )
80- expect ( error . code ) . to eql ( 40400 )
81- expect ( error . status ) . to eql ( 404 )
78+ expect ( error ) . to be_a ( Ably ::Exceptions ::UnauthorizedRequest )
79+ expect ( error . message ) . to match ( /no application id / )
80+ expect ( error . code ) . to eql ( 40101 )
81+ expect ( error . status ) . to eql ( 401 )
8282 end
8383 end
8484 end
Original file line number Diff line number Diff line change @@ -33,9 +33,9 @@ def encode64(text)
3333 it 'logs an entry with a help href url matching the code #TI5' do
3434 begin
3535 client . channels . get ( 'foo' ) . publish ( 'test' )
36- raise 'Expected Ably::Exceptions::ResourceMissing '
37- rescue Ably ::Exceptions ::ResourceMissing => err
38- expect err . to_s . match ( %r{https://help.ably.io/error/40400 } )
36+ raise 'Expected Ably::Exceptions::UnauthorizedRequest '
37+ rescue Ably ::Exceptions ::UnauthorizedRequest => err
38+ expect err . to_s . match ( %r{https://help.ably.io/error/40101 } )
3939 end
4040 end
4141 end
You can’t perform that action at this time.
0 commit comments