#test whatnow2 workflow

. "$MH_TEST_COMMON"
profile="$MMH/profile-send"
cd "$MMH"
cat "`mhparam profile`" - >"$profile" <<!
default-from: Bob <bob@example.org>
Metafile-Extension: .meta
!
cd - >/dev/null
export MMHP="$profile"

runandcheck "comp -editor cat -whatnowproc whatnow2" <<!
To:
Cc:
Fcc: +sent
Subject:
--------
!

runandcheck "cat `mhpath l +drafts`.meta" <<!
mmh-last-editor: cat
mmh-mhdist: 0
!

runandcheck "whatnow2 edit" <<!
To:
Cc:
Fcc: +sent
Subject:
--------
!

runandcheck "cat `mhpath l +drafts`.meta" <<!
mmh-last-editor: cat
mmh-mhdist: 0
!

cat >`mhpath l +drafts` <<!
From: Bob <bob@example.org>
To: alice
Date: Sun, 25 Oct 2015 18:59:56 +0100
Subject: Test
----------------
foo
!

runandcheck 'whatnow2 send -debug | replace_contentid' <<!
From: Bob <bob@example.org>
To: alice
Date: Sun, 25 Oct 2015 18:59:56 +0100
Subject: Test
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-ID: <TESTID>

foo
----EOM----
alice
!
