junk code removed
This commit is contained in:
parent
b19400726f
commit
73ef91cf27
|
@ -271,19 +271,6 @@ class Post < ActiveRecord::Base
|
||||||
Post.excerpt(cooked, maxlength, options)
|
Post.excerpt(cooked, maxlength, options)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
# A list of versions including the initial version
|
|
||||||
def all_versions
|
|
||||||
result = []
|
|
||||||
result << { number: 1, display_username: user.username, created_at: created_at }
|
|
||||||
versions.order(:number).includes(:user).each do |v|
|
|
||||||
if v.user.present?
|
|
||||||
result << { number: v.number, display_username: v.user.username, created_at: v.created_at }
|
|
||||||
end
|
|
||||||
end
|
|
||||||
result
|
|
||||||
end
|
|
||||||
|
|
||||||
def is_first_post?
|
def is_first_post?
|
||||||
post_number == 1
|
post_number == 1
|
||||||
end
|
end
|
||||||
|
|
|
@ -90,8 +90,6 @@ describe PostCreator do
|
||||||
reply = PostCreator.new(admin, raw: "this is my test reply 123 testing", topic_id: created_post.topic_id).create
|
reply = PostCreator.new(admin, raw: "this is my test reply 123 testing", topic_id: created_post.topic_id).create
|
||||||
end
|
end
|
||||||
|
|
||||||
topic_id = created_post.topic_id
|
|
||||||
|
|
||||||
|
|
||||||
messages.map{|m| m.channel}.sort.should == [ "/new",
|
messages.map{|m| m.channel}.sort.should == [ "/new",
|
||||||
"/users/#{admin.username}",
|
"/users/#{admin.username}",
|
||||||
|
@ -110,7 +108,6 @@ describe PostCreator do
|
||||||
p = nil
|
p = nil
|
||||||
messages = MessageBus.track_publish do
|
messages = MessageBus.track_publish do
|
||||||
p = creator.create
|
p = creator.create
|
||||||
topic_id = p.topic_id
|
|
||||||
end
|
end
|
||||||
|
|
||||||
latest = messages.find{|m| m.channel == "/new"}
|
latest = messages.find{|m| m.channel == "/new"}
|
||||||
|
@ -397,7 +394,7 @@ describe PostCreator do
|
||||||
context 'disable validations' do
|
context 'disable validations' do
|
||||||
it 'can save a post' do
|
it 'can save a post' do
|
||||||
creator = PostCreator.new(user, raw: 'q', title: 'q', skip_validations: true)
|
creator = PostCreator.new(user, raw: 'q', title: 'q', skip_validations: true)
|
||||||
post = creator.create
|
creator.create
|
||||||
creator.errors.should be_nil
|
creator.errors.should be_nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue