From a1b9e20d3e46d0eae905602f6d48619cf3c199df Mon Sep 17 00:00:00 2001 From: Leandro Nunes dos Santos Date: Thu, 24 Mar 2016 16:32:03 -0300 Subject: [PATCH] fixing wrong merge with master --- lib/noosfero/api/v1/articles.rb | 2 +- test/unit/api/articles_test.rb | 36 ------------------------------------ 2 files changed, 1 insertion(+), 37 deletions(-) diff --git a/lib/noosfero/api/v1/articles.rb b/lib/noosfero/api/v1/articles.rb index e6a4b89..1f263fe 100644 --- a/lib/noosfero/api/v1/articles.rb +++ b/lib/noosfero/api/v1/articles.rb @@ -221,7 +221,7 @@ module Noosfero end Article.hit(articles) - present_articles_paginated(articles) + present_articles(articles) end desc 'Return one child of a article identified by id' do diff --git a/test/unit/api/articles_test.rb b/test/unit/api/articles_test.rb index 49928be..b143092 100644 --- a/test/unit/api/articles_test.rb +++ b/test/unit/api/articles_test.rb @@ -210,33 +210,6 @@ class ArticlesTest < ActiveSupport::TestCase end end - should 'not perform a vote twice in same article' do - article = fast_create(Article, :profile_id => @person.id, :name => "Some thing") - @params[:value] = 1 - ## Perform a vote twice in API should compute only one vote - post "/api/v1/articles/#{article.id}/vote?#{params.to_query}" - post "/api/v1/articles/#{article.id}/vote?#{params.to_query}" - - total = article.votes_total - - assert_equal 1, total - end - - should 'not perform a vote in favor and against a proposal' do - article = fast_create(Article, :profile_id => @person.id, :name => "Some thing") - @params[:value] = 1 - ## Perform a vote in favor a proposal - post "/api/v1/articles/#{article.id}/vote?#{params.to_query}" - json = JSON.parse(last_response.body) - assert_equal 201, last_response.status - ## Perform a vote against a proposal - @params[:value] = -1 - post "/api/v1/articles/#{article.id}/vote?#{params.to_query}" - json = JSON.parse(last_response.body) - ## The api should not allow to save this vote - assert_equal 400, last_response.status - end - should "update body of article created by me" do new_value = "Another body" params[:article] = {:body => new_value} @@ -713,15 +686,6 @@ class ArticlesTest < ActiveSupport::TestCase assert_includes json["articles"].map { |a| a["id"] }, article2.id end - should 'list articles followed by me' do - article1 = fast_create(Article, :profile_id => user.person.id, :name => "Some thing") - article2 = fast_create(Article, :profile_id => user.person.id, :name => "Some other thing") - article1.person_followers << @person - get "/api/v1/articles/followed_by_me?#{params.to_query}" - json = JSON.parse(last_response.body) - assert_equal [article1.id], json['articles'].map { |a| a['id'] } - end - ARTICLE_ATTRIBUTES = %w(followers_count votes_count comments_count) ARTICLE_ATTRIBUTES.map do |attribute| -- libgit2 0.21.2