-
Notifications
You must be signed in to change notification settings - Fork 653
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "fix: use a pipeline parameter in the email address field (#56…
- Loading branch information
1 parent
0d74983
commit ad45925
Showing
2 changed files
with
2 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -163,49 +163,4 @@ class EmailNotificationAgentSpec extends Specification { | |
name: "foo-stage", | ||
execution: [id: "abc", name: "foo-pipeline"]]) | ||
} | ||
|
||
def "expand email address/cc from parameters"() { | ||
given: | ||
def email = new BlockingVariables() | ||
mailService.send(*_) >> { to, cc, subject, text -> | ||
email.to = to | ||
email.cc = cc | ||
email.subject = subject | ||
email.text = text | ||
} | ||
|
||
when: | ||
agent.sendNotifications( | ||
[address: address, cc: cc], | ||
application, | ||
event, | ||
[type: "stage"], | ||
status | ||
) | ||
|
||
then: | ||
email.to == ["[email protected]"] | ||
email.cc == ["[email protected]"] | ||
|
||
and: | ||
0 * _ | ||
|
||
where: | ||
customSubject = "A custom subject" | ||
customBody = "A **custom** body" | ||
application = "whatever" | ||
address = '''${parameters.EmailTo}''' | ||
cc = '''${parameters.EmailCc}''' | ||
status = "complete" | ||
pipelineName = "foo-pipeline" | ||
stageName = "foo-stage" | ||
trigger = [ parameters: [EmailTo: "[email protected]", | ||
EmailCc: "[email protected]", | ||
]] | ||
|
||
event = new Event(content: [context: [customSubject: customSubject, | ||
customBody: customBody], | ||
name: "foo-stage", | ||
execution: [id: "abc", name: "foo-pipeline", trigger: trigger]]) | ||
} | ||
} |