Skip to content
This repository
tree: f4d94dd514
Fetching contributors…

Cannot retrieve contributors at this time

file 73 lines (72 sloc) 2.897 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
@works @tags
Feature: Edit Works
In order to have an archive full of works
As an author
I want to edit existing works

Scenario: You can't edit a work unless you're logged in and it's your work
Given I have loaded the fixtures
# I'm not logged in
When I view the work "First work"
Then I should not see "Edit"
Given I am logged in as "testuser" with password "testuser"
# This isn't my work
When I view the work "fourth"
Then I should not see "Edit"
When I am on testuser's works page
# These are my works and should all have edit links on the blurbs
Then I should see "Edit"
And I follow "First work"
# This is my individual work and should have an edit link on the show page
Then I should see "first fandom"
And I should see "Edit"
# make sure this tag isn't on before we add it
And I should not see "new tag"
When I follow "Edit"
Then I should see "Edit Work"
When I fill in "work_freeform" with "new tag"
And I fill in "content" with "first chapter content"
And I press "Preview"
Then I should see "Preview"
And I should see "Fandom: first fandom"
And I should see "Additional Tags: new tag"
And I should see "first chapter content"
When I press "Update"
Then I should see "Work was successfully updated."
When I go to testuser's works page
Then I should see "First work"
And I should see "first fandom"
And I should see "new tag"
When I follow "Edit"
And I follow "Add Chapter"
And I fill in "content" with "second chapter content"
And I press "Preview"
Then I should see "preview of what this chapter"
And I should see "second chapter content"
When I press "Post Chapter"
Then I should see "Chapter has been posted!"
And I should see "first chapter content"
And I should not see "second chapter content"
When I follow "Edit"
Then I should not see "chapter content"
When I follow "1"
And I fill in "content" with "first chapter new content"
And I press "Preview"
Then I should see "first chapter new content"
When I press "Update"
Then I should see "Chapter was successfully updated."
And I should see "first chapter new content"
And I should not see "second chapter content"
When I follow "Edit"
And I follow "2"
And I fill in "content" with "second chapter new content"
And I press "Preview"
And I press "Cancel"
Then I should see "second chapter content"
# Test changing pseuds on a work
When I go to testuser's works page
And I follow "Edit"
And I select "testy" from "work_author_attributes_ids_"
And I unselect "testuser" from "work_author_attributes_ids_"
And I press "Post without preview"
Then I should see "testy"
And I should not see "testuser,"
Something went wrong with that request. Please try again.