Skip to content

Commit d521bdb

Browse files
committed
handle asana inbox urls
1 parent a778ae0 commit d521bdb

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

lib/fastlane/plugin/ddg_apple_automation/helper/asana_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class AsanaHelper # rubocop:disable Metrics/ClassLength
2020
ASANA_V0_TASK_URL_REGEX = %r{https://app.asana.com/0/[0-9]+/([0-9]+)(?:/f)?}
2121
# https://app.asana.com/<url_format_version>/<workspace_id>/<object_name>/<object_id>/<subobject_name>/<subobject_id>
2222
ASANA_V1_TASK_URL_REGEX = %r{https://app.asana.com/1/[0-9]+(?:/[0-9a-z/]*)?/task/([0-9]+)(:?/[0-9a-z/]*)?(?:\?focus=true)?}
23-
ASANA_V1_INBOX_URL_REGEX = %r{https://app.asana.com/1/[0-9]+/inbox/([0-9]+)/item/([0-9]+)/story/([0-9]+)}
23+
ASANA_V1_INBOX_URL_REGEX = %r{https://app.asana.com/1/[0-9]+/inbox/[0-9]+/item/([0-9]+)/story/([0-9]+)}
2424

2525
ASANA_WORKSPACE_ID = "137249556945"
2626

spec/asana_helper_spec.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,11 @@ def asana_task_url(task_id)
6969
end
7070

7171
it "fails when garbage is passed" do
72-
expect(Fastlane::UI).to receive(:user_error!)
73-
.with("URL has incorrect format (attempted to match #{Fastlane::Helper::AsanaHelper::ASANA_V0_TASK_URL_REGEX}, #{Fastlane::Helper::AsanaHelper::ASANA_V1_TASK_URL_REGEX} or #{Fastlane::Helper::AsanaHelper::ASANA_V1_INBOX_URL_REGEX")
74-
72+
expect(Fastlane::UI).to receive(:user_error!).with(
73+
"URL has incorrect format (attempted to match #{Fastlane::Helper::AsanaHelper::ASANA_V0_TASK_URL_REGEX}, " \
74+
"#{Fastlane::Helper::AsanaHelper::ASANA_V1_TASK_URL_REGEX} or " \
75+
"#{Fastlane::Helper::AsanaHelper::ASANA_V1_INBOX_URL_REGEX})"
76+
)
7577
extract_asana_task_id("not a URL")
7678
end
7779

0 commit comments

Comments
 (0)