Commit a1b9e20d3e46d0eae905602f6d48619cf3c199df

Authored by Leandro Santos
1 parent ed6f20bb
Exists in staging

fixing wrong merge with master

lib/noosfero/api/v1/articles.rb
... ... @@ -221,7 +221,7 @@ module Noosfero
221 221 end
222 222  
223 223 Article.hit(articles)
224   - present_articles_paginated(articles)
  224 + present_articles(articles)
225 225 end
226 226  
227 227 desc 'Return one child of a article identified by id' do
... ...
test/unit/api/articles_test.rb
... ... @@ -210,33 +210,6 @@ class ArticlesTest < ActiveSupport::TestCase
210 210 end
211 211 end
212 212  
213   - should 'not perform a vote twice in same article' do
214   - article = fast_create(Article, :profile_id => @person.id, :name => "Some thing")
215   - @params[:value] = 1
216   - ## Perform a vote twice in API should compute only one vote
217   - post "/api/v1/articles/#{article.id}/vote?#{params.to_query}"
218   - post "/api/v1/articles/#{article.id}/vote?#{params.to_query}"
219   -
220   - total = article.votes_total
221   -
222   - assert_equal 1, total
223   - end
224   -
225   - should 'not perform a vote in favor and against a proposal' do
226   - article = fast_create(Article, :profile_id => @person.id, :name => "Some thing")
227   - @params[:value] = 1
228   - ## Perform a vote in favor a proposal
229   - post "/api/v1/articles/#{article.id}/vote?#{params.to_query}"
230   - json = JSON.parse(last_response.body)
231   - assert_equal 201, last_response.status
232   - ## Perform a vote against a proposal
233   - @params[:value] = -1
234   - post "/api/v1/articles/#{article.id}/vote?#{params.to_query}"
235   - json = JSON.parse(last_response.body)
236   - ## The api should not allow to save this vote
237   - assert_equal 400, last_response.status
238   - end
239   -
240 213 should "update body of article created by me" do
241 214 new_value = "Another body"
242 215 params[:article] = {:body => new_value}
... ... @@ -713,15 +686,6 @@ class ArticlesTest < ActiveSupport::TestCase
713 686 assert_includes json["articles"].map { |a| a["id"] }, article2.id
714 687 end
715 688  
716   - should 'list articles followed by me' do
717   - article1 = fast_create(Article, :profile_id => user.person.id, :name => "Some thing")
718   - article2 = fast_create(Article, :profile_id => user.person.id, :name => "Some other thing")
719   - article1.person_followers << @person
720   - get "/api/v1/articles/followed_by_me?#{params.to_query}"
721   - json = JSON.parse(last_response.body)
722   - assert_equal [article1.id], json['articles'].map { |a| a['id'] }
723   - end
724   -
725 689 ARTICLE_ATTRIBUTES = %w(followers_count votes_count comments_count)
726 690  
727 691 ARTICLE_ATTRIBUTES.map do |attribute|
... ...