publish_article.feature
5.37 KB
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
Feature: publish article
As a user
I want to publish an article
In order to share it with other users
Background:
Given the following users
| login | name |
| joaosilva | Joao Silva |
| mariasilva | Maria Silva |
And "mariasilva" has no articles
And "joaosilva" has no articles
And the following communities
| identifier | name |
| sample-community | Sample Community |
And the following articles
| owner | name | body |
| joaosilva | Sample Article | This is the first published article |
Scenario: publishing an article that doesn't exists in the community
Given I am logged in as "joaosilva"
And "Joao Silva" is a member of "Sample Community"
And I am on Joao Silva's control panel
And I follow "Manage Content"
And I follow "Spread"
And I check "Sample Community"
And I press "Publish"
And I am on Sample Community's homepage
And I follow "View profile"
And I go to Sample Community's sitemap
When I follow "Sample Article"
Then I should see "This is the first published article"
Scenario: getting an error message when publishing article with same name
Given I am logged in as "joaosilva"
And "Joao Silva" is a member of "Sample Community"
And I am on Joao Silva's control panel
And I follow "Manage Content"
And I follow "Spread"
And I check "Sample Community"
And I press "Publish"
And I am not logged in
And I am logged in as "mariasilva"
And "Maria Silva" is a member of "Sample Community"
And I am on Maria Silva's control panel
And I follow "Manage Content"
And I follow "New article"
And I follow "Text article with Textile markup language"
And I fill in the following:
| Title | Sample Article |
| Text | this is Maria's first published article |
And I press "Save"
And I follow "Spread"
And I check "Sample Community"
When I press "Publish"
Then I should see "Validation failed: The title (article name) is already being used by another article, please use another title.:"
Scenario: publishing an article in many communities and listing the communities that couldn't publish the article again,
stills publishing the article in the other communities.
Given the following communities
| identifier | name |
| another-community1 | Another Community1 |
| another-community2 | Another Community2 |
And I am logged in as "joaosilva"
And "Joao Silva" is a member of "Sample Community"
And "Joao Silva" is a member of "Another Community1"
And "Joao Silva" is a member of "Another Community2"
And I am on Joao Silva's control panel
And I follow "Manage Content"
And I follow "Spread"
And I check "Sample Community"
And I press "Publish"
And I should not see "This article name is already in use in the following community(ies):"
And I am on Joao Silva's control panel
And I follow "Manage Content"
And I follow "Spread"
And I check "Sample Community"
And I check "Another Community1"
And I check "Another Community2"
When I press "Publish"
Then I should see "Validation failed: The title (article name) is already being used by another article, please use another title.:"
And I am on Another Community1's homepage
And I follow "View profile"
When I go to Another Community1's sitemap
Then I should see "Sample Article"
And I am on Another Community2's homepage
And I follow "View profile"
When I go to Another Community2's sitemap
Then I should see "Sample Article"
Scenario: publishing articles with the same name in a moderated community
Given I am logged in as "joaosilva"
And "Joao Silva" is a member of "Sample Community"
And "Joao Silva" is admin of "Sample Community"
And I am on Sample Community's control panel
And I follow "Community Info and settings"
And I choose "profile_data_moderated_articles_true"
And I press "Save"
And I am on Joao Silva's control panel
And I follow "Manage Content"
And I follow "Spread"
And I check "Sample Community"
And I press "Publish"
And I am on Joao Silva's control panel
And I follow "Manage Content"
And I follow "Spread"
And I check "Sample Community"
And I press "Publish"
And I am on Sample Community's control panel
And I follow "Tasks"
And I press "Ok!"
And I should not see "Validation failed: The title (article name) is already being used by another article, please use another title.:"
When I press "Ok!"
Then I should see "Validation failed: The title (article name) is already being used by another article, please use another title."
Scenario: ask to publish an article that was deleted before approval
Given I am logged in as "joaosilva"
And "Joao Silva" is admin of "Sample Community"
And I am on Sample Community's control panel
And I follow "Community Info and settings"
And I choose "profile_data_moderated_articles_true"
And I press "Save"
And I am on Joao Silva's control panel
And I follow "Manage Content"
And I follow "Spread"
And I check "Sample Community"
And I press "Publish"
And "joaosilva" has no articles
And I am on Sample Community's control panel
When I follow "Tasks"
Then I should see /Joao Silva wanted.*deleted/
And I press "Ok!"
Then I should not see /Joao Silva wanted.*deleted/