summaryrefslogtreecommitdiff
path: root/testing
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2017-03-06 15:38:28 +0000
committerDaniel Silverstone <dsilvers@digital-scurf.org>2017-03-06 15:38:28 +0000
commitd330a38c84d98b0940487b3334f13894b63dadf5 (patch)
tree06dc76b086310929ea33908a3c1a81e9ab118fef /testing
parent5a71f43b6a2da5a9bafcd7b2c9b6c5bd3177186a (diff)
downloadgitano-d330a38c84d98b0940487b3334f13894b63dadf5.tar.gz
adds a force-push checking scenariodsilvers/force-push-testing
Diffstat (limited to 'testing')
-rw-r--r--testing/03-force-pushing.yarn34
1 files changed, 34 insertions, 0 deletions
diff --git a/testing/03-force-pushing.yarn b/testing/03-force-pushing.yarn
new file mode 100644
index 0000000..5d8e98a
--- /dev/null
+++ b/testing/03-force-pushing.yarn
@@ -0,0 +1,34 @@
+<!-- -*- Markdown -*- -->
+
+Force Pushing
+=============
+
+The default ruleset of Gitano denies force-pushing to everyone except the
+`gitano-admin` group by default; requiring that projects explicitly enable it
+if they want it. The theory being that it can be permitted for some branches
+but not others, and by deny-by-default, it encourages project owners to think
+hard before granting force-push.
+
+ SCENARIO alice cannot force-push by default
+
+ GIVEN a standard instance
+ AND a unix user called alice
+ AND alice has keys called main
+
+ WHEN testinstance, using adminkey, adds user alice, using alice main
+ AND testinstance adminkey runs create testrepo alice
+ AND alice, using main, clones testrepo as testrepo
+ THEN alice testrepo has no file called FOO
+
+ WHEN alice applies add-a-FOO.patch in testrepo
+ AND alice, using main, pushes testrepo to testrepo.git
+ THEN the output contains new branch
+
+ WHEN alice amends testrepo with oh well never mind
+ AND alice, using main, expecting failure, pushes testrepo to testrepo.git
+ THEN the output contains non-fast-forward
+
+ WHEN alice, using main, expecting failure, force-pushes testrepo to testrepo.git
+ THEN stderr contains denied action
+
+ FINALLY the instance is torn down