Commit 55f8ec553d31c4081a26b591b51be8a5c1ff9c9c
Committed by
Macartur Sousa
1 parent
a5fbefdf
Exists in
elasticsearch_api
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,11 +9,15 @@ class ArticlesTest < ActiveSupport::TestCase | ||
9 | 9 | ||
10 | should 'remove article' do | 10 | should 'remove article' do |
11 | article = fast_create(Article, :profile_id => user.person.id, :name => "Some thing") | 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 | post "/api/v1/articles/#{article.id}/remove?#{params.to_query}" | 14 | post "/api/v1/articles/#{article.id}/remove?#{params.to_query}" |
13 | json = JSON.parse(last_response.body) | 15 | json = JSON.parse(last_response.body) |
14 | 16 | ||
15 | assert_not_equal 401, last_response.status | 17 | assert_not_equal 401, last_response.status |
16 | assert_equal true, json['success'] | 18 | assert_equal true, json['success'] |
19 | + | ||
20 | + assert !Article.exists?(article.id) | ||
17 | end | 21 | end |
18 | 22 | ||
19 | should 'list articles' do | 23 | should 'list articles' do |