Commit 99e9e72f52f0a4a45e71189c041f8f5b6c7e1855
1 parent
d32b13d5
Exists in
master
and in
23 other branches
Fixing broken tests on content_viewer
Showing
1 changed file
with
5 additions
and
0 deletions
Show diff stats
test/functional/content_viewer_controller_test.rb
| ... | ... | @@ -1014,6 +1014,7 @@ class ContentViewerControllerTest < ActionController::TestCase |
| 1014 | 1014 | profile = create_user('testuser').person |
| 1015 | 1015 | article = profile.articles.build(:name => 'test') |
| 1016 | 1016 | article.save! |
| 1017 | + Comment.destroy_all | |
| 1017 | 1018 | comment = Comment.create!(:author => profile, :title => 'a comment', :body => 'lalala', :article => article) |
| 1018 | 1019 | login_as 'testuser' |
| 1019 | 1020 | get :view_page, :profile => 'testuser', :page => [ 'test' ] |
| ... | ... | @@ -1063,6 +1064,7 @@ class ContentViewerControllerTest < ActionController::TestCase |
| 1063 | 1064 | should 'not show a post comment button on top if there is only one comment' do |
| 1064 | 1065 | profile = create_user('testuser').person |
| 1065 | 1066 | article = profile.articles.build(:name => 'test') |
| 1067 | + Comment.destroy_all | |
| 1066 | 1068 | article.save! |
| 1067 | 1069 | comment = article.comments.build(:author => profile, :title => 'hi', :body => 'hello') |
| 1068 | 1070 | comment.save! |
| ... | ... | @@ -1073,6 +1075,7 @@ class ContentViewerControllerTest < ActionController::TestCase |
| 1073 | 1075 | should 'not show a post comment button on top if there are no comments' do |
| 1074 | 1076 | profile = create_user('testuser').person |
| 1075 | 1077 | article = profile.articles.build(:name => 'test') |
| 1078 | + Comment.destroy_all | |
| 1076 | 1079 | article.save! |
| 1077 | 1080 | get :view_page, :profile => 'testuser', :page => [ 'test' ] |
| 1078 | 1081 | assert_no_tag :tag => 'a', :attributes => { :id => 'top-post-comment-button' } |
| ... | ... | @@ -1081,6 +1084,7 @@ class ContentViewerControllerTest < ActionController::TestCase |
| 1081 | 1084 | should 'show a post comment button on top if there are at least two comments' do |
| 1082 | 1085 | profile = create_user('testuser').person |
| 1083 | 1086 | article = profile.articles.build(:name => 'test') |
| 1087 | + Comment.destroy_all | |
| 1084 | 1088 | article.save! |
| 1085 | 1089 | comment1 = article.comments.build(:author => profile, :title => 'hi', :body => 'hello') |
| 1086 | 1090 | comment1.save! |
| ... | ... | @@ -1093,6 +1097,7 @@ class ContentViewerControllerTest < ActionController::TestCase |
| 1093 | 1097 | should 'not show a post comment button on top if there are one comment and one reply' do |
| 1094 | 1098 | profile = create_user('testuser').person |
| 1095 | 1099 | article = profile.articles.build(:name => 'test') |
| 1100 | + Comment.destroy_all | |
| 1096 | 1101 | article.save! |
| 1097 | 1102 | comment1 = article.comments.build(:author => profile, :title => 'hi', :body => 'hello') |
| 1098 | 1103 | comment1.save! | ... | ... |