summaryrefslogtreecommitdiff
path: root/yarns
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2016-03-25 20:33:33 +0200
committerLars Wirzenius <liw@liw.fi>2016-03-25 20:33:33 +0200
commit99aa0893ad5cb5f798f889a09f6f6521a4432ba1 (patch)
tree5aee82b400aea95d4a4df4f86aefdf984de06442 /yarns
parent36656efe16604153743d4140570498fffa3bcc45 (diff)
downloaddistix-99aa0893ad5cb5f798f889a09f6f6521a4432ba1.tar.gz
Set key/value pair on tickets when importing mail
Diffstat (limited to 'yarns')
-rw-r--r--yarns/080-import-mail.yarn23
-rw-r--r--yarns/900-implements.yarn15
2 files changed, 38 insertions, 0 deletions
diff --git a/yarns/080-import-mail.yarn b/yarns/080-import-mail.yarn
index 7d7a1b8..ada7182 100644
--- a/yarns/080-import-mail.yarn
+++ b/yarns/080-import-mail.yarn
@@ -125,3 +125,26 @@ Ditto, but for mailboxes.
THEN attempt succeeded
AND output matches "^[0-9a-f]{32} .* bar$"
AND output doesn't match "^[0-9a-f]{32} .* blerf$"
+
+When users send new mails to tickets that are already closed, the
+"status" key needs to get updated. In other words, a ticket that has
+the metadata "status=closed" should lose that.
+
+ SCENARIO ticket gets re-opened upon importing new mail
+
+ WHEN user attempts to run distix init REPO
+ THEN attempt succeeded
+
+ GIVEN file MBOX1 containing "From foo@example.com Mon Mar 19 09:46:32 2012\nFrom: foo@example.com\nSubject: bar\nMessage-Id: one@example.com\n\nyo\n"
+ WHEN user attempts to run distix import-mbox REPO MBOX1
+ THEN attempt succeeded
+
+ GIVEN file MBOX2 containing "From foo@example.com Mon Mar 19 09:46:32 2012\nFrom: foo2@example.com\nSubject: blerf\nMessage-Id: <two@example.com>\nReferences: <one@example.com>\n\nyo\n"
+ WHEN user sets all tickets in REPO to status=closed
+ AND user attempts to run distix import-mbox REPO MBOX2 status=
+ THEN attempt succeeded
+
+ WHEN user changes working directory to REPO
+ AND user attempts to run distix list status!=closed
+ THEN attempt succeeded
+ AND output matches "."
diff --git a/yarns/900-implements.yarn b/yarns/900-implements.yarn
index d5ca4bf..cbf8ea4 100644
--- a/yarns/900-implements.yarn
+++ b/yarns/900-implements.yarn
@@ -42,6 +42,21 @@ be, and changing there when running various commands.
echo "$?" > "$DATADIR/attempt.exit"
fi
+ IMPLEMENTS WHEN user sets all tickets in (\S+) to (\S+)
+ cd "$DATADIR/$MATCH_1"
+
+ "$SRCDIR/distix" --no-default-config --quiet \
+ --log "$DATADIR/distix.log" list |
+ awk '{ print $1 }' > "$DATADIR/tickets.list"
+
+ cat "$DATADIR/tickets.list" |
+ while read ticket
+ do
+ "$SRCDIR/distix" --no-default-config --quiet \
+ --log "$DATADIR/distix.log" \
+ set "$ticket" "$MATCH_2"
+ done
+
We also need steps for inspecting the results of attempting to run
distix.