From 263c7bd1273707d207e1c727d5030f421f483efc Mon Sep 17 00:00:00 2001 From: Rodrigo Souto Date: Thu, 2 Jun 2011 11:33:52 -0300 Subject: [PATCH] Adding rejection-explantion to approve-article task --- app/models/approve_article.rb | 11 +++++++++++ features/approve_article.feature | 23 ++++++++++++++++++++--- 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/app/models/approve_article.rb b/app/models/approve_article.rb index 4bc32e7..8681f65 100644 --- a/app/models/approve_article.rb +++ b/app/models/approve_article.rb @@ -77,6 +77,10 @@ class ApproveArticle < Task true end + def reject_details + true + end + def default_decision if article 'skip' @@ -107,4 +111,11 @@ class ApproveArticle < Task end end + def task_cancelled_message + message = _('Your request for publishing the article "{article}" was rejected.') + if !reject_explanation.blank? + message += " " + _("Here is the reject explanation left by the administrator who rejected your article: \n\n%{reject_explanation}") % {:reject_explanation => reject_explanation} + end + end + end diff --git a/features/approve_article.feature b/features/approve_article.feature index 44d4665..d0dcfd5 100644 --- a/features/approve_article.feature +++ b/features/approve_article.feature @@ -5,9 +5,9 @@ Feature: approve article Background: Given the following users - | login | name | - | joaosilva | Joao Silva | - | mariasilva | Maria Silva | + | login | name | email | + | joaosilva | Joao Silva | joaosilva@example.com | + | mariasilva | Maria Silva | mariasilva@example.com | And the following articles | owner | name | body | homepage | | mariasilva | Sample Article | This is an article | true | @@ -34,3 +34,20 @@ Feature: approve article And I go to Sample Community's sitemap And I follow "Sample Article" Then I should see "This is an article edited" + + @selenium + Scenario: reject an article with explanation + Given I am logged in as "mariasilva" + And I go to Maria Silva's cms + And I follow "Sample Article" + And I follow "Spread" and wait + And I check "Sample Community" + And I press "Spread this" + And I am logged in as "joaosilva" + And I go to Sample Community's control panel + And I follow "Process requests" and wait + And I choose "Reject" + And I fill in "Rejection explanation" with "This is not an appropriate article for this community." + And I press "Apply!" + When I go to Sample Community's sitemap + Then I should not see "Sample Article" -- libgit2 0.21.2