Commit 07eff5ff by Rocky Duan

fixed Rakefile

parent 5f4bd140
...@@ -20,7 +20,7 @@ task :environment do ...@@ -20,7 +20,7 @@ task :environment do
end end
namespace :test do namespace :test do
task :check_nested_comments => :environment do task :nested_comments => :environment do
puts "checking" puts "checking"
50.times do 50.times do
Comment.delete_all Comment.delete_all
...@@ -31,19 +31,19 @@ namespace :test do ...@@ -31,19 +31,19 @@ namespace :test do
commentable = Commentable.create!(commentable_type: "questions", commentable_id: "1") commentable = Commentable.create!(commentable_type: "questions", commentable_id: "1")
user = User.create!(id: "1") user = User.create!(external_id: "1")
comment_thread = commentable.comment_threads.create!(title: "I can't solve this problem", body: "can anyone help me?", course_id: "1") comment_thread = commentable.comment_threads.new(title: "I can't solve this problem", body: "can anyone help me?", course_id: "1")
comment_thread.author = user comment_thread.author = user
comment_thread.save! comment_thread.save!
comment = comment_thread.comments.create!(body: "this problem is so easy", course_id: "1") comment = comment_thread.comments.new(body: "this problem is so easy", course_id: "1")
comment.author = user comment.author = user
comment.save! comment.save!
comment1 = comment.children.create!(body: "not for me!", course_id: "1") comment1 = comment.children.new(body: "not for me!", course_id: "1")
comment1.author = user comment1.author = user
comment1.save! comment1.save!
comment2 = comment1.children.create!(body: "not for me neither!", course_id: "1") comment2 = comment1.children.new(body: "not for me neither!", course_id: "1")
comment2.author = user comment2.author = user
comment2.save! comment2.save!
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment