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