fixed unit tests
This commit is contained in:
@@ -93,7 +93,7 @@ class Pool < ActiveRecord::Base
|
||||
def neighbor_posts(post)
|
||||
@neighbor_posts ||= begin
|
||||
post_ids =~ /\A#{post.id} (\d+)|(\d+) #{post.id} (\d+)|(\d+) #{post.id}\Z/
|
||||
|
||||
|
||||
if $2 && $3
|
||||
{:previous => $2.to_i, :next => $3.to_i}
|
||||
elsif $1
|
||||
|
||||
@@ -220,7 +220,7 @@ class Post < ActiveRecord::Base
|
||||
end
|
||||
|
||||
def flag!(reason)
|
||||
flag = create_flag(:reason => reason)
|
||||
flag = flags.create(:reason => reason)
|
||||
|
||||
if flag.errors.any?
|
||||
raise PostFlag::Error.new(flag.errors.full_messages.join("; "))
|
||||
@@ -230,7 +230,7 @@ class Post < ActiveRecord::Base
|
||||
end
|
||||
|
||||
def appeal!(reason)
|
||||
appeal = create_appeal(:reason => reason)
|
||||
appeal = appeals.create(:reason => reason)
|
||||
|
||||
if appeal.errors.any?
|
||||
raise PostAppeal::Error.new(appeal.errors.full_messages.join("; "))
|
||||
|
||||
Reference in New Issue
Block a user