From dd6f391e74ee2d3a0821053b4950e5e2226dbbfd Mon Sep 17 00:00:00 2001 From: Cesy Date: Tue, 8 Feb 2011 22:02:47 +0000 Subject: [PATCH 1/2] Beefing up the anonymity test a little, to cover unrevealed bookmarks --- features/collection_anonymity.feature | 18 ++++++++++++++++++ features/support/paths.rb | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/features/collection_anonymity.feature b/features/collection_anonymity.feature index 96199c498c2..a021fb2db84 100644 --- a/features/collection_anonymity.feature +++ b/features/collection_anonymity.feature @@ -67,16 +67,34 @@ Feature: Collection Then I should see "New Snippet by myname1" And I should see "Old Snippet by myname1" And I should see "Another Snippet by myname1" + + # bookmark a hidden work + When I follow "Another Snippet" + And I follow "Bookmark" + And I fill in "bookmark_notes" with "I liked this story" + And I press "Create" + Then I should see "Bookmark was successfully created" When I follow "Log out" + And I go to "Hidden Treasury" collection's page Then I should see "Mystery Work" And I should see "Part of Hidden Treasury" + When I go to the bookmarks page + Then I should see "List of Bookmarks" + And "Issue 2208" is fixed + # And I should see "Mystery Work" + # And I should not see "Another Snippet" + And I should see "Another Snippet" When I am logged in as "myname2" with password "something" And I go to the collections page And I follow "Hidden Treasury" Then I should see "Mystery Work" And I should see "Part of Hidden Treasury" + And I should not see "Old Snippet" + And I should not see "Another Snippet" + And I should not see "New Snippet" + And I should not see "myname1" # Reveal the collection When I follow "Settings" diff --git a/features/support/paths.rb b/features/support/paths.rb index f6960ef540d..c1870570414 100644 --- a/features/support/paths.rb +++ b/features/support/paths.rb @@ -61,7 +61,7 @@ def path_to(page_name) skin_path(Skin.find_by_title($1)) when /^"(.*)" edit skin page/ edit_skin_path(Skin.find_by_title($1)) - when /^(.*) collection's page$/i + when /^"(.*)" collection's page$/i # e.g. when I go to "Collection name" collection's page collection_path(Collection.find_by_title($1)) when /^"(.*)" collection's static page$/i static_collection_path(Collection.find_by_title($1)) From 53cf5ad36b3d431940aab1b9eae905aeccbd339f Mon Sep 17 00:00:00 2001 From: Cesy Date: Tue, 8 Feb 2011 22:22:01 +0000 Subject: [PATCH 2/2] Adding some more bookmark tests for anonymous but revealed as well --- features/collection_anonymity.feature | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/features/collection_anonymity.feature b/features/collection_anonymity.feature index a021fb2db84..cf905bfa0fd 100644 --- a/features/collection_anonymity.feature +++ b/features/collection_anonymity.feature @@ -142,7 +142,11 @@ Feature: Collection Then I should not see "This work is part of an ongoing challenge and will be revealed soon" And I should see "This is another new snippet written for this hidden challenge" - + # bookmark should now be revealed + When I go to the bookmarks page + Then I should see "List of Bookmarks" + And I should not see "Mystery Work" + And I should see "Another Snippet" Scenario: Create an anonymous collection, add new and existing works to it, reveal authors @@ -208,11 +212,22 @@ Feature: Collection Then I should see "New Snippet by Anonymous" And I should see "Old Snippet by Anonymous" And I should see "Another Snippet by Anonymous" + + # bookmark an anonymous work + When I follow "Another Snippet" + And I follow "Bookmark" + And I fill in "bookmark_notes" with "I liked this story" + And I press "Create" + Then I should see "Bookmark was successfully created" When I follow "Log out" + And I go to "Anonymous Hugs" collection's page Then I should see "New Snippet by Anonymous" And I should see "Old Snippet by Anonymous" And I should see "Another Snippet by Anonymous" + When I go to the bookmarks page + Then I should see "List of Bookmarks" + And I should see "Another Snippet by Anonymous" When I am logged in as "myname2" with password "something" And I go to the collections page @@ -249,6 +264,11 @@ Feature: Collection When I view the work "Another Snippet" Then I should see "myname1" within ".byline" - + # bookmark should now be revealed + When I go to the bookmarks page + Then I should see "List of Bookmarks" + And I should see "Another Snippet by myname1" + And I should not see "Another Snippet by Anonymous" # Scenario: TODO Create a hidden and anonymous collection, add new and existing works to it, reveal works, then reveal authors + # Isn't this partially covered by challenge_yuletide? Probably better to expand that.