diff --git a/test/integration/air_trail_export_flow_test.rb b/test/integration/air_trail_export_flow_test.rb index 8ce4b3a..212c51e 100644 --- a/test/integration/air_trail_export_flow_test.rb +++ b/test/integration/air_trail_export_flow_test.rb @@ -2,7 +2,7 @@ require "test_helper" class AirTrailExportFlowTest < ActionDispatch::IntegrationTest setup do - @pilot = create_user("ricky@example.com") + @pilot = create_user("jane@example.com") @a = create_aircraft(pilot: @pilot, owner: create_user, tail_number: "N12345") @a.flight_logs.create!(date: Date.current, departure_location: "KOQU", destination_location: "KBID", tach_time: 0.5) sign_in @pilot @@ -13,10 +13,10 @@ class AirTrailExportFlowTest < ActionDispatch::IntegrationTest assert_select "a[href='#{new_aircraft_air_trail_export_path(@a)}']", text: "Export for AirTrail" get new_aircraft_air_trail_export_path(@a) assert_response :success - assert_select "input[name='username'][value='ricky']" + assert_select "input[name='username'][value='jane']" assert_select "form[data-turbo='false']" - post aircraft_air_trail_export_path(@a), params: { username: "ricky", aircraft_type: "C150", scope: "all" } + post aircraft_air_trail_export_path(@a), params: { username: "jane", aircraft_type: "C150", scope: "all" } assert_response :success assert_equal "application/json", response.media_type assert_match(/attachment; filename="n12345-airtrail-.*\.json"/, response.headers["Content-Disposition"]) diff --git a/test/integration/air_trail_sync_flow_test.rb b/test/integration/air_trail_sync_flow_test.rb index a54da09..746bda3 100644 --- a/test/integration/air_trail_sync_flow_test.rb +++ b/test/integration/air_trail_sync_flow_test.rb @@ -20,7 +20,7 @@ class AirTrailSyncFlowTest < ActionDispatch::IntegrationTest connect assert_redirected_to air_trail_connection_path follow_redirect! - assert_match "Connected to AirTrail as ricky", response.body + assert_match "Connected to AirTrail as jane", response.body assert_equal "https://airtrail.test", @user.air_trail_connection.base_url perform_enqueued_jobs do diff --git a/test/integration/setup_test.rb b/test/integration/setup_test.rb index 8009f72..ba3b402 100644 --- a/test/integration/setup_test.rb +++ b/test/integration/setup_test.rb @@ -4,7 +4,7 @@ class SetupTest < ActionDispatch::IntegrationTest test "first run creates admin, then setup is closed" do get root_path assert_redirected_to new_setup_path - post setup_path, params: { user: { name: "Ricky", email_address: "a@b.com", password: "test-password-123", password_confirmation: "test-password-123" } } + post setup_path, params: { user: { name: "Jane", email_address: "a@b.com", password: "test-password-123", password_confirmation: "test-password-123" } } assert_redirected_to root_path assert User.last.admin? get new_setup_path diff --git a/test/services/air_trail_export_test.rb b/test/services/air_trail_export_test.rb index 1d44fd5..96572f4 100644 --- a/test/services/air_trail_export_test.rb +++ b/test/services/air_trail_export_test.rb @@ -11,13 +11,13 @@ class AirTrailExportTest < ActiveSupport::TestCase tach_time: tach, hobbs_time: hobbs, user: user, notes: notes) end - def export(**opts) = AirTrailExport.new(@a, username: "ricky", **opts) + def export(**opts) = AirTrailExport.new(@a, username: "jane", **opts) test "builds AirTrail's import format" do fly Date.new(2026, 10, 24), "KLHV", "44N", tach: 1.9, hobbs: 2.0, notes: "Fall colors" data = JSON.parse(export(aircraft_type: "c150").to_json) - assert_equal [ { "id" => "sam-pilot", "username" => "ricky", "displayName" => "ricky" } ], data["users"] + assert_equal [ { "id" => "sam-pilot", "username" => "jane", "displayName" => "jane" } ], data["users"] f = data["flights"].first assert_equal "2026-10-24", f["date"] assert_equal "day", f["datePrecision"] @@ -83,6 +83,6 @@ class AirTrailExportTest < ActiveSupport::TestCase assert_not AirTrailExport.new(@a, username: "ri").valid? assert_not AirTrailExport.new(@a, username: "jane pilot").valid? assert_not export(aircraft_type: "CESSNA").valid? - assert_not AirTrailExport.new(create_aircraft, username: "ricky").valid? # no flights + assert_not AirTrailExport.new(create_aircraft, username: "jane").valid? # no flights end end diff --git a/test/services/air_trail_syncer_test.rb b/test/services/air_trail_syncer_test.rb index 4aa2146..6529b03 100644 --- a/test/services/air_trail_syncer_test.rb +++ b/test/services/air_trail_syncer_test.rb @@ -30,11 +30,11 @@ class AirTrailSyncerTest < ActiveSupport::TestCase body = @fake.flights.fetch(sync.remote_id) assert_equal [ "2026-10-24", 101, 102, 7, 2160, "N12345" ], body.values_at("date", "fromId", "toId", "aircraftId", "duration", "aircraftReg") - assert_equal [ { "userId" => "u-ricky", "guestName" => nil, "seat" => "pilot", "seatNumber" => nil, + assert_equal [ { "userId" => "u-jane", "guestName" => nil, "seat" => "pilot", "seatNumber" => nil, "seatClass" => nil, "flightReason" => nil, "customFields" => {} } ], body["passengers"] assert_equal "gpx", body.dig("track", "sourceFormat") assert_equal [ -71.412028, 41.597139, 5.2 ], body.dig("track", "coordinates", 0) - assert_equal "ricky", @connection.reload.remote_username + assert_equal "jane", @connection.reload.remote_username end test "unchanged flights aren't re-sent; changed ones are replaced; deleted-in-AirTrail ones recreated" do diff --git a/test/support/fake_air_trail.rb b/test/support/fake_air_trail.rb index e2a9bf6..b1e2f33 100644 --- a/test/support/fake_air_trail.rb +++ b/test/support/fake_air_trail.rb @@ -44,7 +44,7 @@ class FakeAirTrail query = URI.decode_www_form(req.uri.query.to_s).to_h case [ req.method, path ] in [ :get, "/api/v1/me" ] - json(200, data: { id: "u-ricky", username: "ricky", displayName: "Ricky", role: nil, isOwner: true, + json(200, data: { id: "u-jane", username: "jane", displayName: "Jane", role: nil, isOwner: true, permissions: [], credential: { kind: "apiKey", scopes: @scopes } }) in [ :get, "/api/v1/airports" ] code = query["query"].to_s.upcase