(data)
| 628 | } |
| 629 | |
| 630 | function doEdits(data) { |
| 631 | describe(`edit ${data.path}`, function() { |
| 632 | // |
| 633 | // "live" is a clone of origin (this is what's on the production server) |
| 634 | // "dev" is a clone of origin (this is what's on someone's laptop) |
| 635 | // "origin" is the bare git repo |
| 636 | // |
| 637 | // in LIVE |
| 638 | // - writeAndCommitFileInLive does git commit |
| 639 | // - pullInLive does git pull |
| 640 | // in DEV |
| 641 | // - pullAndVerifyFileInDev does git pull |
| 642 | // - writeAndPushFileInDev does git push |
| 643 | // |
| 644 | // Remember that "origHash" has whatever was on disk at last GET. |
| 645 | // |
| 646 | // (live at last post, live, dev, origin) |
| 647 | // |
| 648 | |
| 649 | editGet(data.url, false, false, data.contentsA, null); |
| 650 | // (A, A, A, A) |
| 651 | |
| 652 | badPost('save_and_sync', data.contentsB, data.url); |
| 653 | // (A, A, A, A) |
| 654 | |
| 655 | editPost('save_and_sync', data.contentsB, data.url, true, false, null); |
| 656 | // (B, B, A, B) |
| 657 | |
| 658 | waitForJobSequence(locals, 'Success'); |
| 659 | pullAndVerifyFileInDev(data.path, data.contentsB); |
| 660 | // (B, B, B, B) |
| 661 | |
| 662 | editGet(data.url, false, false, data.contentsB, null); |
| 663 | // (B, B, B, B) |
| 664 | |
| 665 | writeAndCommitFileInLive(data.path, data.contentsA); |
| 666 | // (B, A, B, B) |
| 667 | |
| 668 | editGet(data.url, false, false, data.contentsA, null); |
| 669 | // (A, A, B, B) |
| 670 | |
| 671 | writeAndCommitFileInLive(data.path, data.contentsB); |
| 672 | // (A, B, B, B) |
| 673 | |
| 674 | editPost('save_and_sync', data.contentsC, data.url, true, true, data.contentsB); |
| 675 | // (A, B, B, B) |
| 676 | |
| 677 | waitForJobSequence(locals, 'Error'); |
| 678 | pullAndVerifyFileInDev(data.path, data.contentsB); |
| 679 | // (A, B, B, B) |
| 680 | |
| 681 | editGet(data.url, false, false, data.contentsB, null); |
| 682 | // (B, B, B, B) |
| 683 | |
| 684 | editPost('save_and_sync', data.contentsA, data.url, true, false, null); |
| 685 | // (A, A, B, A) |
| 686 | |
| 687 | waitForJobSequence(locals, 'Success'); |
no test coverage detected