cirandas.net

ref: master

features/blog.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
 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
135
136
137
Feature: blog
  As a noosfero user
  I want to have one or mutiple blogs

  Background:
    Given I am on the homepage
    And the following users
      | login | name |
      | joaosilva | Joao Silva |
    And "joaosilva" has no articles
    And I am logged in as "joaosilva"

  Scenario: create a blog
    Given I go to joaosilva's control panel
    And I follow "Create blog"
    Then I should see "My Blog"
    When I fill in "Title" with "My Blog"
    And I fill in "Address" with "my-blog"
    And I press "Save"
    And I go to joaosilva's control panel
    Then I should see "Configure blog"

  Scenario: redirect to blog after create blog from control panel
    Given I go to joaosilva's control panel
    And I follow "Create blog"
    Then I should see "My Blog"
    When I fill in "Title" with "My Blog"
    And I fill in "Address" with "my-blog"
    And I press "Save"
    Then I should be on /joaosilva/my-blog

  Scenario: redirect to blog after create blog from cms
    Given I go to joaosilva's control panel
    And I follow "Manage Content"
    And I follow "New content"
    When I follow "Blog"
    And I fill in "Title" with "Blog from cms"
    And I fill in "Address" with "blog-from-cms"
    And I press "Save"
    Then I should be on /joaosilva/blog-from-cms

  Scenario: create multiple blogs
    Given I go to joaosilva's control panel
    And I follow "Manage Content"
    And I follow "New content"
    And I follow "Blog"
    And I fill in "Title" with "Blog One"
    And I fill in "Address" with "blog-one"
    And I press "Save"
    Then I go to joaosilva's control panel
    And I follow "Manage Content"
    And I follow "New content"
    And I follow "Blog"
    And I fill in "Title" with "Blog Two"
    And I fill in "Address" with "blog-two"
    And I press "Save"
    Then I should not see "error"
    And I should be on /joaosilva/blog-two

  Scenario: cancel button back to cms
    Given I go to joaosilva's control panel
    And I follow "Manage Content"
    And I follow "New content"
    And I follow "Blog"
    When I follow "Cancel" within ".main-block"
    Then I should be on /myprofile/joaosilva/cms

  Scenario: cancel button back to myprofile
    Given I go to joaosilva's control panel
    And I follow "Create blog"
    When I follow "Cancel" within ".main-block"
    Then I should be on /myprofile/joaosilva

  Scenario: configure blog link to cms
    Given the following blogs
      | owner     | name     |
      | joaosilva | Blog One |
      | joaosilva | Blog Two |
    And I go to joaosilva's control panel
    When I follow "Configure blog"
    Then I should be on /myprofile/joaosilva/cms

  Scenario: configure blog link to edit blog
    Given the following blogs
       | owner     | name     |
       | joaosilva | Blog One |
    And I go to joaosilva's control panel
    When I follow "Configure blog"
    Then I should be on edit "Blog One" by joaosilva

  @selenium
  Scenario: configure blog when viewing it
    Given the following blogs
       | owner     | name     |
       | joaosilva | Blog One |
    And I go to /joaosilva/blog-one
    When I follow "Configure blog"
    Then I should be on edit "Blog One" by joaosilva

  Scenario: change address of blog
    Given the following blogs
      | owner     | name     |
      | joaosilva | Blog One |
    And I go to joaosilva's control panel
    And I follow "Configure blog"
    And I fill in "Address" with "blog-two"
    And I press "Save"
    When I am on /joaosilva/blog-two
    Then I should see "Blog One"

  Scenario: display tag list field when creating new blog
    Given I go to joaosilva's control panel
    And I follow "Manage Content"
    And I follow "New content"
    When I follow "Blog"
    Then I should see "Tag list"

  Scenario: do not display the "clear cover image" when there is no uploaded image
    Given the following blogs
      | owner     | name    |
      | joaosilva | My Blog |
    And I go to joaosilva's control panel
    And I follow "Configure blog"
    Then I should not see "Delete cover image"

  # the step for attaching a file on the input only works with capybara 1.1.2, but it requires rails 1.9.3
  @selenium
  Scenario: display cover image after uploading an image as the blog cover
    Given the following blogs
      | owner     | name    |
      | joaosilva | My Blog |
    And I go to joaosilva's control panel
    And I follow "Configure blog"
    And I attach the file "public/images/rails.png" to "Uploaded data"
    And I press "Save"
    When I am on /joaosilva/my-blog
    Then there should be a div with class "blog-cover"