fixed unit tests

This commit is contained in:
albert
2011-03-30 15:11:22 -04:00
parent f749e82da9
commit aee5cf0aa1
7 changed files with 41 additions and 27 deletions

View File

@@ -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

View File

@@ -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("; "))