Skip to content

Commit

Permalink
Update spec for report_status
Browse files Browse the repository at this point in the history
  • Loading branch information
ayoy committed Sep 17, 2024
1 parent f6ef4b2 commit 3697b20
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions spec/tag_release_action_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -312,15 +312,14 @@
let (:task_template) { "task-template" }
let (:comment_template) { "comment-template" }
let (:created_task_id) { "12345" }
let (:template_args) { {} }

include_context "common setup"

before do
@params[:is_scheduled_release] = false
@params[:is_internal_release_bump] = false

allow(Fastlane::Actions::TagReleaseAction).to receive(:template_arguments).and_return({})
# allow(Fastlane::Actions::TagReleaseAction).to receive(:setup_asana_templates).and_return([task_template, comment_template])
allow(Fastlane::Actions::TagReleaseAction).to receive(:template_arguments).and_return(template_args)
allow(Fastlane::UI).to receive(:important)
allow(Fastlane::Actions::AsanaCreateActionItemAction).to receive(:run).and_return(created_task_id)
allow(Fastlane::Actions::AsanaLogMessageAction).to receive(:run)
Expand All @@ -336,23 +335,14 @@
end
end

shared_examples "logging a message without creating Asana task" do
it "logs a message creating Asana task" do
subject
expect(Fastlane::Actions::TagReleaseAction).to have_received(:template_arguments).with(@params)
expect(Fastlane::Actions::TagReleaseAction).to have_received(:setup_asana_templates).with(@params)
expect(Fastlane::Actions::AsanaCreateActionItemAction).not_to have_received(:run)
expect(Fastlane::Actions::AsanaLogMessageAction).to have_received(:run)
end
end

shared_examples "creating Asana task and logging a message" do
it "creates Asana task and logs a message" do
subject
expect(Fastlane::Actions::TagReleaseAction).to have_received(:template_arguments).with(@params)
expect(Fastlane::Actions::TagReleaseAction).to have_received(:setup_asana_templates).with(@params)
expect(Fastlane::Actions::AsanaCreateActionItemAction).to have_received(:run)
expect(Fastlane::Actions::AsanaLogMessageAction).to have_received(:run)
expect(template_args['task_id']).to eq(created_task_id)
end
end

Expand Down Expand Up @@ -384,6 +374,7 @@

expect(calls.last).to include(template_name: "run-publish-dmg-release")
expect(Fastlane::Actions::AsanaLogMessageAction).to have_received(:run)
expect(template_args['task_id']).to eq(created_task_id)
end
end
end
Expand Down

0 comments on commit 3697b20

Please sign in to comment.