diff --git a/e2e/lib/action_cable_client.rb b/e2e/lib/action_cable_client.rb index b79cadc..64ee4cd 100644 --- a/e2e/lib/action_cable_client.rb +++ b/e2e/lib/action_cable_client.rb @@ -47,12 +47,16 @@ module TurniereE2E return if @closed @closed = true - driver.close - socket.close + @driver&.close + @socket&.close rescue IOError, SystemCallError nil end + def url + websocket_url + end + private attr_reader :base_url, :socket, :driver @@ -93,10 +97,6 @@ module TurniereE2E "#{uri.scheme}://#{uri.host}:#{uri.port}" end - def url - websocket_url - end - def write(data) socket.write(data) end diff --git a/spec/e2e/http/tournament_sync_test_spec.rb b/spec/e2e/http/tournament_sync_test_spec.rb index 5507f5e..9d0b871 100644 --- a/spec/e2e/http/tournament_sync_test_spec.rb +++ b/spec/e2e/http/tournament_sync_test_spec.rb @@ -67,7 +67,7 @@ RSpec.describe 'Tournament sync test HTTP E2E' do leader_after_playoffs = fetch_tournament(leader.fetch(:id)) token_list = find_playoff_token_list!(leader_after_playoffs) first_item = token_list.fetch(:team_action_items).first - second_item = token_list.fetch(:team_action_items).second + second_item = token_list.fetch(:team_action_items)[1] update_by_item_id = client.patch("/team_action_items/#{first_item.fetch(:id)}", body: { completed: true }) expect(update_by_item_id[:status]).to eq(200)