Skip to content

Commit 498cf22

Browse files
committed
Add failing test for deleting a draft with published=false when live does not exist
1 parent 2e4c9f6 commit 498cf22

File tree

2 files changed

+82
-0
lines changed

2 files changed

+82
-0
lines changed

features/publishable/publishable.feature

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,14 @@ Feature: Access to unpublished/draft resources should be configurable
328328
And the resource "publishable_draft" should not exist
329329
And the resource "publishable_published" should exist
330330

331+
@loginAdmin
332+
Scenario: As a user with draft access, I can delete a draft resource when it does not have a live variant using the published=false parameter.
333+
Given there is a publishable resource set to publish at "2999-12-31T23:59:59+00:00"
334+
When I send a "DELETE" request to the resource "publishable_draft" and the postfix "?published=false"
335+
Then the response status code should be 204
336+
And the resource "publishable_draft" should not exist
337+
And the resource "publishable_published" should exist
338+
331339
@loginUser
332340
Scenario: As a user which does not normally have draft access, I can delete a component where security groups are configured to allow it
333341
Given there is a DummyPublishableWithSecurityGroups resource set to publish at "2999-12-31T23:59:59+00:00"

±

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# System-wide profile for interactive zsh(1) shells.
2+
3+
# Setup user specific overrides for this in ~/.zshrc. See zshbuiltins(1)
4+
# and zshoptions(1) for more details.
5+
6+
# Correctly display UTF-8 with combining characters.
7+
if [[ "$(locale LC_CTYPE)" == "UTF-8" ]]; then
8+
setopt COMBINING_CHARS
9+
fi
10+
11+
# Disable the log builtin, so we don't conflict with /usr/bin/log
12+
disable log
13+
14+
# Save command history
15+
HISTFILE=${ZDOTDIR:-$HOME}/.zsh_history
16+
HISTSIZE=2000
17+
SAVEHIST=1000
18+
19+
# Beep on error
20+
setopt BEEP
21+
22+
# Use keycodes (generated via zkbd) if present, otherwise fallback on
23+
# values from terminfo
24+
if [[ -r ${ZDOTDIR:-$HOME}/.zkbd/${TERM}-${VENDOR} ]] ; then
25+
source ${ZDOTDIR:-$HOME}/.zkbd/${TERM}-${VENDOR}
26+
else
27+
typeset -g -A key
28+
29+
[[ -n "$terminfo[kf1]" ]] && key[F1]=$terminfo[kf1]
30+
[[ -n "$terminfo[kf2]" ]] && key[F2]=$terminfo[kf2]
31+
[[ -n "$terminfo[kf3]" ]] && key[F3]=$terminfo[kf3]
32+
[[ -n "$terminfo[kf4]" ]] && key[F4]=$terminfo[kf4]
33+
[[ -n "$terminfo[kf5]" ]] && key[F5]=$terminfo[kf5]
34+
[[ -n "$terminfo[kf6]" ]] && key[F6]=$terminfo[kf6]
35+
[[ -n "$terminfo[kf7]" ]] && key[F7]=$terminfo[kf7]
36+
[[ -n "$terminfo[kf8]" ]] && key[F8]=$terminfo[kf8]
37+
[[ -n "$terminfo[kf9]" ]] && key[F9]=$terminfo[kf9]
38+
[[ -n "$terminfo[kf10]" ]] && key[F10]=$terminfo[kf10]
39+
[[ -n "$terminfo[kf11]" ]] && key[F11]=$terminfo[kf11]
40+
[[ -n "$terminfo[kf12]" ]] && key[F12]=$terminfo[kf12]
41+
[[ -n "$terminfo[kf13]" ]] && key[F13]=$terminfo[kf13]
42+
[[ -n "$terminfo[kf14]" ]] && key[F14]=$terminfo[kf14]
43+
[[ -n "$terminfo[kf15]" ]] && key[F15]=$terminfo[kf15]
44+
[[ -n "$terminfo[kf16]" ]] && key[F16]=$terminfo[kf16]
45+
[[ -n "$terminfo[kf17]" ]] && key[F17]=$terminfo[kf17]
46+
[[ -n "$terminfo[kf18]" ]] && key[F18]=$terminfo[kf18]
47+
[[ -n "$terminfo[kf19]" ]] && key[F19]=$terminfo[kf19]
48+
[[ -n "$terminfo[kf20]" ]] && key[F20]=$terminfo[kf20]
49+
[[ -n "$terminfo[kbs]" ]] && key[Backspace]=$terminfo[kbs]
50+
[[ -n "$terminfo[kich1]" ]] && key[Insert]=$terminfo[kich1]
51+
[[ -n "$terminfo[kdch1]" ]] && key[Delete]=$terminfo[kdch1]
52+
[[ -n "$terminfo[khome]" ]] && key[Home]=$terminfo[khome]
53+
[[ -n "$terminfo[kend]" ]] && key[End]=$terminfo[kend]
54+
[[ -n "$terminfo[kpp]" ]] && key[PageUp]=$terminfo[kpp]
55+
[[ -n "$terminfo[knp]" ]] && key[PageDown]=$terminfo[knp]
56+
[[ -n "$terminfo[kcuu1]" ]] && key[Up]=$terminfo[kcuu1]
57+
[[ -n "$terminfo[kcub1]" ]] && key[Left]=$terminfo[kcub1]
58+
[[ -n "$terminfo[kcud1]" ]] && key[Down]=$terminfo[kcud1]
59+
[[ -n "$terminfo[kcuf1]" ]] && key[Right]=$terminfo[kcuf1]
60+
fi
61+
62+
# Default key bindings
63+
[[ -n ${key[Delete]} ]] && bindkey "${key[Delete]}" delete-char
64+
[[ -n ${key[Home]} ]] && bindkey "${key[Home]}" beginning-of-line
65+
[[ -n ${key[End]} ]] && bindkey "${key[End]}" end-of-line
66+
[[ -n ${key[Up]} ]] && bindkey "${key[Up]}" up-line-or-search
67+
[[ -n ${key[Down]} ]] && bindkey "${key[Down]}" down-line-or-search
68+
69+
# Default prompt
70+
PS1="%n@%m %1~ %# "
71+
72+
# Useful support for interacting with Terminal.app or other terminal programs
73+
[ -r "/etc/zshrc_$TERM_PROGRAM" ] && . "/etc/zshrc_$TERM_PROGRAM"
74+

0 commit comments

Comments
 (0)