junk code removed

This commit is contained in:
Sam 2014-03-07 19:00:09 +11:00
parent b19400726f
commit 73ef91cf27
2 changed files with 1 additions and 17 deletions

View File

@ -271,19 +271,6 @@ class Post < ActiveRecord::Base
Post.excerpt(cooked, maxlength, options)
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?
post_number == 1
end

View File

@ -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
end
topic_id = created_post.topic_id
messages.map{|m| m.channel}.sort.should == [ "/new",
"/users/#{admin.username}",
@ -110,7 +108,6 @@ describe PostCreator do
p = nil
messages = MessageBus.track_publish do
p = creator.create
topic_id = p.topic_id
end
latest = messages.find{|m| m.channel == "/new"}
@ -397,7 +394,7 @@ describe PostCreator do
context 'disable validations' do
it 'can save a post' do
creator = PostCreator.new(user, raw: 'q', title: 'q', skip_validations: true)
post = creator.create
creator.create
creator.errors.should be_nil
end
end