cosyn / vek

incredibly simple blog...not worth using for anyone but me

vek / features / authoring_articles.feature
100644 77 lines (67 sloc) 3.725 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
Feature: Managing articles on the site
  As an authenticated user of the site
  I should be able to create, modify, and delete articles
  So that I can add content to the site
 
  Scenario: Attempting to visit 'admin' area without logging in
    When I go to article admin page
    Then I should see the login form
 
  Scenario: Log out of the 'admin' area
    Given I have signed in as user "jenny" with a password of "password"
    When I go to article admin page
    And I follow "logout"
    When I go to article admin page
    Then I should see the login form
 
  Scenario: Navigating to page for creating a 'new article'
    Given I have signed in as user "jenny" with a password of "password"
    When I go to article admin page
    And I follow "new_post"
    Then I should see the form for creating new articles
 
  Scenario: Creating a new article
    Given I have signed in as user "jenny" with a password of "password"
    When I go to article admin page
    And I follow "new_post"
    And I fill in "article[title]" with "My first article"
    And I fill in "article[body]" with "This is my first article ever"
    And I press "Create"
    Then I should see "My first article"
    And the 1st row of the list of articles should contain a TD element with a CSS class of "me"
 
  Scenario: Editing an existing article
    Given I have signed in as user "jenny" with a password of "password"
    And "tom" has created an article with the title "My First Article" and a body of "The original body"
    When I go to article admin page
    And I follow the "edit" link for the article titled "My First Article"
    And I fill in "article[title]" with "I have updated the title"
    And I press "Update"
    Then I should see "I have updated the title"
 
  Scenario: Deleting an existing article
    Given I have signed in as user "jenny" with a password of "password"
    And "jenny" has created an article with the title "My First Article" and a body of "The original body"
    When I go to article admin page
    And I follow the "edit" link for the article titled "My First Article"
    And I follow the "delete" link for the article titled "My First Article"
    Then I should not see "My First Article"
 
  Scenario: Reviewing which user created an article
    Given I have created 3 articles as user "tom" with a password of "psswrd"
    And I have created 1 articles as user "jenny" with a password of "password"
    And I have signed in as user "jenny" with a password of "password"
    When I go to article admin page
    Then the 1st row of the list of articles should contain a TD element with a CSS class of "me"
    And the 2nd row of the list of articles should contain a TD element with a CSS class of "other_author"
    And the 3rd row of the list of articles should contain a TD element with a CSS class of "other_author"
    And the 4th row of the list of articles should contain a TD element with a CSS class of "other_author"
 
  Scenario: Attempting to create a new article without a title
    Given I have signed in as user "jenny" with a password of "password"
    When I go to article admin page
    When I follow "new_post"
    And I fill in "article[title]" with ""
    And I fill in "article[body]" with "This is my first article ever"
    And I press "Create"
    Then I should see the form for creating new articles
 
  Scenario: Attempting to create a new article without a body
    Given I have signed in as user "jenny" with a password of "password"
    When I go to article admin page
    When I follow "new_post"
    And I fill in "article[title]" with "Sample title"
    And I fill in "article[body]" with ""
    And I press "Create"
    Then I should see the form for creating new articles