-
Notifications
You must be signed in to change notification settings - Fork 2
fix: convert "manual" service ids error into changeset error #1352
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -217,6 +217,28 @@ defmodule Arrow.Integration.Disruptionsv2.TrainsformerExportSectionTest do | |
| ) | ||
| end | ||
|
|
||
| feature "reports errors about missing service ids and route ids", %{session: session} do | ||
| disruption = disruption_v2_fixture(%{mode: :commuter_rail}) | ||
|
|
||
| session | ||
| |> visit("/disruptions/#{disruption.id}") | ||
| |> click(text("Upload Trainsformer export")) | ||
| |> assert_text("Upload Trainsformer .zip") | ||
| |> attach_file(file_field("trainsformer_export", visible: false), | ||
| path: | ||
| "test/support/fixtures/trainsformer/invalid,reasons=no-trips,no-stop-times,no-multi-route-trips.zip" | ||
| ) | ||
| |> assert_text( | ||
| "Successfully imported export invalid,reasons=no-trips,no-stop-times,no-multi-route-trips.zip!" | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. note: I don't like the "successfully imported" but actually there's errors, but I think we can fix that later/follow up PR? thoughts?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd prefer something like "Imported export with warnings" if possible. I personally think it would be fine to do that as part of this PR since it should be a relatively small change, but happy to put it off if it ends up being difficult. |
||
| ) | ||
| |> assert_text("Export must contain at least one Service ID") | ||
| |> assert_text("Export must contain at least one route") | ||
| |> click(Query.css("#save-export-button")) | ||
| |> assert_text("Export must contain at least one Service ID") | ||
| |> assert_text("Export must contain at least one route") | ||
| |> assert_has(Query.css("#save-export-button")) | ||
| end | ||
|
|
||
| feature "can cancel uploading a Trainsformer export", %{session: session} do | ||
| disruption = disruption_v2_fixture(%{mode: :commuter_rail}) | ||
|
|
||
|
|
||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. contents: : unzip -c test/support/fixtures/trainsformer/invalid,reasons=no-trips,no-stop-times,no-multi-route-trips.zip
Archive: test/support/fixtures/trainsformer/invalid,reasons=no-trips,no-stop-times,no-multi-route-trips.zip
extracting: multi_route_trips.txt
added_route_id,trip_id
inflating: stop_times.txt
trip_id,arrival_time,departure_time,stop_id,stop_sequence,stop_headsign,pickup_type,drop_off_type,timepoint,bikes_allowed,nonstandard_track
inflating: trips.txt
route_id,service_id,trip_id,trip_headsign,trip_short_name,shape_id,direction_id,bikes_allowed,event_time |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the reason for this PR is that I needed to get rid of this "error", because it's being used in a way that is both handled by
Changeset's and doesn't match the way I want to return errors from the export validations, and conveniently, it actually makes it simpler to remove this code.