Skip to content
Snippets Groups Projects
Commit 2d121b4a authored by ArtOfCode-'s avatar ArtOfCode-
Browse files

It does but there's no easy way to test it

parent 96483742
Branches
Tags
No related merge requests found
...@@ -32,16 +32,6 @@ class PostTest < ActiveSupport::TestCase ...@@ -32,16 +32,6 @@ class PostTest < ActiveSupport::TestCase
assert_equal previous_rep, post.user.reputation assert_equal previous_rep, post.user.reputation
end end
test 'adding an answer should increase answer_count' do
question = posts(:question_one)
pre_count = question.answer_count
Post.create(body_markdown: 'abcde fghij klmno pqrst uvwxyz', body: '<p>abcde fghij klmno pqrst uvwxyz</p>',
score: 0, user: users(:standard_user), parent: question, post_type_id: Answer.post_type_id,
category: question.category)
post_count = question.answer_count
assert_equal pre_count + 1, post_count
end
test 'reassigning post should move post votes and rep change' do test 'reassigning post should move post votes and rep change' do
post = posts(:question_one) post = posts(:question_one)
rep_change = Vote.total_rep_change(post.votes) rep_change = Vote.total_rep_change(post.votes)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment