Skip to content

Commit

Permalink
Update expected return
Browse files Browse the repository at this point in the history
The expected result has changed in this test, as per this internal Slack
thread[1].

[1] https://ably-real-time.slack.com/archives/CURL4U2FP/p1733479167314059?thread_ts=1733420816.469159&cid=CURL4U2FP
  • Loading branch information
surminus committed Feb 12, 2025
1 parent e4424a9 commit 491a6a6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion spec/acceptance/realtime/client_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
client.connection.once(:failed) do
expect(custom_logger_object.logs.find do |severity, message|
next unless %w(fatal error).include?(severity.to_s)
message.match(%r{https://help.ably.io/error/40400})
message.match(%r{https://help.ably.io/error/40101})
end).to_not be_nil
stop_reactor
end
Expand Down
12 changes: 6 additions & 6 deletions spec/acceptance/realtime/connection_failures_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
error = connection_state_change.reason
expect(connection.state).to eq(:failed)
# TODO: Check error type is an InvalidToken exception
expect(error.status).to eq(404)
expect(error.code).to eq(40400) # not found
expect(error.status).to eq(401)
expect(error.code).to eq(40101) # not found
stop_reactor
end
end
Expand All @@ -46,7 +46,7 @@
error = connection_state_change.reason
expect(connection.state).to eq(:failed)
# TODO: Check error type is a TokenNotFound exception
expect(error.status).to eq(401)
expect(error.status).to eq(404)
expect(error.code).to eq(40400) # not found
stop_reactor
end
Expand Down Expand Up @@ -1396,10 +1396,10 @@ def kill_connection_transport_and_prevent_valid_resume
channel = client.channels.get("foo")
channel.attach do
connection.once(:failed) do |state_change|
expect(state_change.reason.code).to eql(40400)
expect(connection.error_reason.code).to eql(40400)
expect(state_change.reason.code).to eql(40101)
expect(connection.error_reason.code).to eql(40101)
expect(channel).to be_failed
expect(channel.error_reason.code).to eql(40400)
expect(channel.error_reason.code).to eql(40101)
stop_reactor
end

Expand Down
6 changes: 3 additions & 3 deletions spec/acceptance/rest/client_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ def encode64(text)
it 'logs an entry with a help href url matching the code #TI5' do
begin
client.channels.get('foo').publish('test')
raise 'Expected Ably::Exceptions::ResourceMissing'
rescue Ably::Exceptions::ResourceMissing => err
expect err.to_s.match(%r{https://help.ably.io/error/40400})
raise 'Expected Ably::Exceptions::UnauthorizedRequest'
rescue Ably::Exceptions::UnauthorizedRequest => err
expect err.to_s.match(%r{https://help.ably.io/error/40101})
end
end
end
Expand Down

0 comments on commit 491a6a6

Please sign in to comment.