package host import "testing" // The member-facing refusal texts are approved copy (zdd.refuse.* // and zdd.refuse.restart in the plan 6 copy list). The other tests compare // against the constants, so this one pins the words themselves: a change here // is a copy change and goes through review. func TestRolloutRefusalDrafts(t *testing.T) { for name, tc := range map[string]struct{ got, want string }{ "no-store": {refuseTexts[rolloutNoStore], "this box cannot start instances right now: the deploy store is unavailable"}, "no-release-key": {refuseTexts[rolloutNoReleaseKey], "this box cannot start instances right now: the release key is unavailable"}, "book-unreadable": {refuseTexts[rolloutBookUnreadable], "this box cannot start instances right now: its record of failed builds cannot be read"}, "no-swaps": {refuseNoSwaps, "this box cannot run two builds side by side, which this instance's build needs"}, "restart": {rolloutRestartRefused, "restart refused: this box cannot restart instances right now"}, } { if tc.got != tc.want { t.Errorf("%s: %q, want the draft %q", name, tc.got, tc.want) } } }