forked from alphagov/whitehall
/
publishing-policies.feature
54 lines (45 loc) · 2.83 KB
/
publishing-policies.feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
Feature: Publishing policies
In order to allow the public to view policies
A departmental editor
Should be able to publish policies
Background:
Given I am an editor
Scenario: Publishing a submitted publication
Given a submitted policy "Ban Beards" exists
When I publish the policy "Ban Beards"
Then my attempt to publish "Ban Beards" should succeed
And I should see the policy "Ban Beards" in the list of published documents
And the policy "Ban Beards" should be visible to the public
Scenario: Trying to publish a policy that has been changed by another user
Given a submitted policy "Ban Beards" exists
When I publish the policy "Ban Beards" but another user edits it while I am viewing it
Then my attempt to publish "Ban Beards" should fail
Scenario: Maintain existing relationships
Given a published news article "Government to reduce hirsuteness" with related published policies "Ban Beards" and "Unimportant"
When I publish a new edition of the policy "Ban Beards" with the new title "Ban Facial Hair"
And I visit the news article "Government to reduce hirsuteness"
Then I can see links to the related published policies "Ban Facial Hair" and "Unimportant"
Scenario: Publishing a first edition without a change note
Given a submitted policy "Ban Beards" exists
When I publish the policy "Ban Beards" without a change note
Then my attempt to publish "Ban Beards" should succeed
And I should see the policy "Ban Beards" in the list of published documents
And the policy "Ban Beards" should be visible to the public
Scenario: Publishing a subsequent edition without a change note
Given a published policy "Ban Beards" exists
When I publish a new edition of the policy "Ban Beards" without a change note
Then my attempt to publish "Ban Beards" should fail
Scenario: Publishing a subsequent edition with a change note
Given a published policy "Ban Beards" exists
When I publish a new edition of the policy "Ban Beards" with a change note "Exempted Santa Claus"
Then my attempt to publish "Ban Beards" should succeed
And I should see the policy "Ban Beards" in the list of published documents
And the policy "Ban Beards" should be visible to the public
And the change note "Exempted Santa Claus" should appear in the history for the policy "Ban Beards"
Scenario: Viewing policy publishing history
Given a published policy "Ban Beards" exists
When I publish a new edition of the policy "Ban Beards" with a change note "Exempted Santa Claus"
And I publish a new edition of the policy "Ban Beards" with a change note "Exempted Gimli son of Gloin"
Then the policy "Ban Beards" should be visible to the public
And the change note "Exempted Santa Claus" should appear in the history for the policy "Ban Beards"
And the change note "Exempted Gimli son of Gloin" should appear in the history for the policy "Ban Beards"