diff --git a/lib/fastlane/plugin/ddg_apple_automation/helper/asana_helper.rb b/lib/fastlane/plugin/ddg_apple_automation/helper/asana_helper.rb index d6492bb..f7f33ee 100644 --- a/lib/fastlane/plugin/ddg_apple_automation/helper/asana_helper.rb +++ b/lib/fastlane/plugin/ddg_apple_automation/helper/asana_helper.rb @@ -282,6 +282,7 @@ def self.update_asana_tasks_for_public_release(params) # Complete tasks that don't require a post-mortem. UI.message("Completing tasks") + task_ids.delete(params[:release_task_id]) complete_tasks(task_ids, params[:asana_access_token]) UI.message("Done completing tasks") @@ -292,7 +293,6 @@ def self.update_asana_tasks_for_public_release(params) # Construct release announcement task description UI.message("Preparing release announcement task") - task_ids.delete(params[:release_task_id]) Helper::ReleaseTaskHelper.construct_release_announcement_task_description(params[:version], release_notes, task_ids) end diff --git a/spec/asana_helper_spec.rb b/spec/asana_helper_spec.rb index 162b1df..8b8a397 100644 --- a/spec/asana_helper_spec.rb +++ b/spec/asana_helper_spec.rb @@ -369,7 +369,7 @@ def sanitize_asana_html_notes(content) let(:tag_name) { "7.122.0" } let(:tag_id) { "7.122.0" } - let(:task_ids) { ["task1", "task2", "task3"] } + let(:task_ids) { ["1234567890", "1234567891", "1234567892"] } let(:release_notes) { "Release notes content" } before do @@ -400,10 +400,11 @@ def sanitize_asana_html_notes(content) expect(Fastlane::UI).to have_received(:message).with("Fetching #{tag_name} Asana tag") expect(Fastlane::UI).to have_received(:success).with("#{tag_name} tag URL: https://app.asana.com/0/#{tag_id}/list") expect(Fastlane::UI).to have_received(:message).with("Fetching tasks tagged with #{tag_name}") - expect(Fastlane::UI).to have_received(:success).with("#{task_ids.count} task(s) found.") + expect(Fastlane::UI).to have_received(:success).with("3 task(s) found.") expect(Fastlane::UI).to have_received(:message).with("Moving tasks to Done section") expect(Fastlane::UI).to have_received(:success).with("All tasks moved to Done section") expect(Fastlane::UI).to have_received(:message).with("Completing tasks") + expect(task_ids).to eq(["1234567891", "1234567892"]) # Check function removes release task expect(Fastlane::UI).to have_received(:message).with("Done completing tasks") expect(Fastlane::UI).to have_received(:message).with("Fetching release notes from Asana release task (https://app.asana.com/0/0/1234567890/f)") expect(Fastlane::UI).to have_received(:success).with("Release notes: #{release_notes}")