From 6a1964325ad74966d9041f329d84192a5b69fedb Mon Sep 17 00:00:00 2001 From: Antonio Terceiro Date: Mon, 30 Nov 2009 14:50:00 -0300 Subject: [PATCH] Adding step to remove all articles from a profile --- features/publish_article.feature | 18 ++---------------- features/step_definitions/noosfero_steps.rb | 4 ++++ 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/features/publish_article.feature b/features/publish_article.feature index 5f4f13b..9d9ca20 100644 --- a/features/publish_article.feature +++ b/features/publish_article.feature @@ -8,6 +8,8 @@ Feature: publish article | login | name | | joaosilva | Joao Silva | | mariasilva | Maria Silva | + And "mariasilva" has no articles + And "joaosilva" has no articles And the following communities | identifier | name | | sample-community | Sample Community | @@ -20,10 +22,6 @@ Feature: publish article And "Joao Silva" is a member of "Sample Community" And I am on Joao Silva's control panel And I follow "Manage Content" - #These "deletes" are to remove default articles and spread the correct created one - And I follow "Delete" - And I follow "Delete" - And I follow "Delete" And I follow "Spread" And I check "Sample Community" And I press "Publish" @@ -39,9 +37,6 @@ Feature: publish article And "Joao Silva" is a member of "Sample Community" And I am on Joao Silva's control panel And I follow "Manage Content" - And I follow "Delete" - And I follow "Delete" - And I follow "Delete" And I follow "Spread" And I check "Sample Community" And I press "Publish" @@ -55,9 +50,6 @@ Feature: publish article | Title | Sample Article | | Text | this is Maria's first published article | And I press "Save" - And I follow "Delete" - And I follow "Delete" - And I follow "Delete" And I follow "Spread" And I check "Sample Community" When I press "Publish" @@ -75,9 +67,6 @@ Feature: publish article And "Joao Silva" is a member of "Another Community2" And I am on Joao Silva's control panel And I follow "Manage Content" - And I follow "Delete" - And I follow "Delete" - And I follow "Delete" And I follow "Spread" And I check "Sample Community" And I press "Publish" @@ -107,9 +96,6 @@ Feature: publish article And I press "Save" And I am on Joao Silva's control panel And I follow "Manage Content" - And I follow "Delete" - And I follow "Delete" - And I follow "Delete" And I follow "Spread" And I check "Sample Community" And I press "Publish" diff --git a/features/step_definitions/noosfero_steps.rb b/features/step_definitions/noosfero_steps.rb index f7366a6..d4e3a27 100644 --- a/features/step_definitions/noosfero_steps.rb +++ b/features/step_definitions/noosfero_steps.rb @@ -107,3 +107,7 @@ Given /^"(.+)" is admin of "(.+)"$/ do |person, organization| user = Profile.find_by_name(person) org.add_admin(user) end + +Given /^"([^\"]*)" has no articles$/ do |profile| + (Profile[profile] || Profile.find_by_name(profile)).articles.delete_all +end -- libgit2 0.21.2