Feature: Post to blog In order to keep my blog up-to-date As an admin I want to create and manage blog posts Scenario: View empty list of blog posts Given I have a blog "My Blog" When go to the admin_blogs page And I follow "Manage Posts" Then I should see "Blog Posts" And I should see "No posts have been written yet." Scenario: View populated list of blog posts Given I have a blog "My Blog" Given the following blog posts exist: | title | content | state | | Foo | Foo is foo. | draft | | Bar | Bar is bar. | published | When go to the admin_blogs page And I follow "Manage Posts" Then I should see "Blog Posts" And I should see "Foo" And I should see "Bar" Scenario: Create a draft blog post Given I have a blog "My Blog" When go to the admin_blogs page And I follow "Manage Posts" And I follow "New Post..." Then I should see "Create a New Post" And I fill in "post_title" with "My First Post" And I select "Draft" from "post_state" And I fill in "content_field" with "Blah blah blah" And I press "Save" Then I should see "About This Post" And I should see "My First Post" And post slug should be "my-first-post" Scenario: Attach an image to a blog post Scenario: Edit a blog post Given I have a blog "My Blog" Given the following blog posts exist: | title | content | state | | Foo | Foo is foo. | draft | When go to the admin_blogs page And I follow "Manage Posts" And I follow "Edit" within "[@class='crud_links']" Then I should see "Edit a Post" And I fill in "post_title" with "My Earliest Post" And I press "Save" Then I should see "About This Post" And I should see "My Earliest Post" Scenario: Publish a blog post Given I have a blog "My Blog" Given the following blog posts exist: | title | content | state | | Foo | Foo is foo. | draft | When go to the admin_blogs page And I follow "Manage Posts" And I follow "Edit" within "[@class='crud_links']" And I press "Publish" Then I should see "About This Post" And I should see "Published" Scenario: Delete a blog post Given I have a blog "My Blog" Given the following blog posts exist: | title | content | state | | Foo | Foo is foo. | draft | When go to the admin_blogs page And I follow "Manage Posts" And I press "" within "[@class='crud_links']" Then I should see "Blog Posts" And I should not see "Foo"