diff --git a/app/views/tasks/_suggest_article_accept_details.rhtml b/app/views/tasks/_suggest_article_accept_details.rhtml index de9989f..51aeea0 100644 --- a/app/views/tasks/_suggest_article_accept_details.rhtml +++ b/app/views/tasks/_suggest_article_accept_details.rhtml @@ -5,6 +5,7 @@ <%= labelled_form_field(_("Source URL"), f.text_field(:source)) %> <%= select_profile_folder(_('Select the folder where the article must be published'), "tasks[#{task.id}][task]", 'article_parent_id', task.target) %> +<%= labelled_form_field(_('Highlight this article'), f.check_box(:highlighted)) %>
<%= labelled_form_field(_('Lead'), f.text_area(:article_abstract, :style => 'width: 482px; height: 200px;')) %> diff --git a/features/step_definitions/noosfero_steps.rb b/features/step_definitions/noosfero_steps.rb index f2fda44..7356c7f 100644 --- a/features/step_definitions/noosfero_steps.rb +++ b/features/step_definitions/noosfero_steps.rb @@ -337,3 +337,13 @@ Given /^the community "(.+)" is closed$/ do |community| community.closed = true community.save end + +Given /^someone suggested the following article to be published$/ do |table| + SuggestArticle.skip_captcha! + table.hashes.map{|item| item.dup}.each do |item| + target = Community[item.delete('target')] + task = SuggestArticle.create!(:target => target, :data => item) + end +end + + diff --git a/features/suggest_article.feature b/features/suggest_article.feature new file mode 100644 index 0000000..dc64d70 --- /dev/null +++ b/features/suggest_article.feature @@ -0,0 +1,23 @@ +Feature: suggest article + As a not logged user + I want to suggest an article + In order to share it with other users + + Background: + Given the following users + | login | name | + | joaosilva | Joao Silva | + And the following communities + | identifier | name | + | sample-community | Sample Community | + And "Joao Silva" is admin of "Sample Community" + + Scenario: highlight an article before approval of a suggested article + Given someone suggested the following article to be published + | target | article_name | article_body | name | email | + | sample-community | A suggested article | this is an article about whales | jose | jose@example.org | + When I am logged in as "joaosilva" + And I go to Sample Community's control panel + And I follow "Process requests" + And I should see "suggested the publication of the article" + Then I should see "Highlight this article" within ".task_box" -- libgit2 0.21.2