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 | 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 | ... | ... |