Commit f159aad41a0e3bf40c41932ed5a444016b6d3c40

Authored by Carlos Purificação
1 parent f40b0ca9

Added test assertion on article existence

Showing 1 changed file with 4 additions and 0 deletions   Show diff stats
test/api/articles_test.rb
... ... @@ -9,11 +9,15 @@ class ArticlesTest < ActiveSupport::TestCase
9 9  
10 10 should 'remove article' do
11 11 article = fast_create(Article, :profile_id => user.person.id, :name => "Some thing")
  12 + article = Article.find(article.id)
  13 + assert_not_nil article
12 14 post "/api/v1/articles/#{article.id}/remove?#{params.to_query}"
13 15 json = JSON.parse(last_response.body)
14 16  
15 17 assert_not_equal 401, last_response.status
16 18 assert_equal true, json['success']
  19 +
  20 + assert !Article.exists?(article.id)
17 21 end
18 22  
19 23 should 'list articles' do
... ...