FEATURE: Allow posting a link with topics

This commit is contained in:
Erick Guan
2016-12-05 13:31:43 +01:00
parent e82084405e
commit 52763f5115
50 changed files with 503 additions and 77 deletions

View File

@ -28,7 +28,7 @@ module Helpers
args[:title] ||= "This is my title #{Helpers.next_seq}"
user = args.delete(:user) || Fabricate(:user)
guardian = Guardian.new(user)
args[:category] = args[:category].name if args[:category].is_a?(Category)
args[:category] = args[:category].id if args[:category].is_a?(Category)
TopicCreator.create(user, guardian, args)
end
@ -37,7 +37,7 @@ module Helpers
args[:raw] ||= "This is the raw body of my post, it is cool #{Helpers.next_seq}"
args[:topic_id] = args[:topic].id if args[:topic]
user = args.delete(:user) || Fabricate(:user)
args[:category] = args[:category].name if args[:category].is_a?(Category)
args[:category] = args[:category].id if args[:category].is_a?(Category)
creator = PostCreator.new(user, args)
post = creator.create