fix attr_accessible
This commit is contained in:
@@ -7,6 +7,6 @@ Factory.define(:note) do |f|
|
||||
f.height 0
|
||||
f.is_active true
|
||||
f.body {Faker::Lorem.sentences.join}
|
||||
f.updater_id {|x| x.creator_id}
|
||||
f.updater_id {|x| x.association(:user)}
|
||||
f.updater_ip_addr "127.0.0.1"
|
||||
end
|
||||
|
||||
@@ -8,6 +8,7 @@ class CommentTest < ActiveSupport::TestCase
|
||||
CurrentUser.ip_addr = "127.0.0.1"
|
||||
MEMCACHE.flush_all
|
||||
Danbooru.config.stubs(:member_comment_limit).returns(100)
|
||||
Danbooru.config.stubs(:member_comment_time_threshold).returns(1.week.from_now)
|
||||
end
|
||||
|
||||
teardown do
|
||||
|
||||
@@ -6,6 +6,7 @@ class IpBanTest < ActiveSupport::TestCase
|
||||
CurrentUser.user = @user
|
||||
CurrentUser.ip_addr = "127.0.0.1"
|
||||
MEMCACHE.flush_all
|
||||
Danbooru.config.stubs(:member_comment_time_threshold).returns(1.week.from_now)
|
||||
end
|
||||
|
||||
teardown do
|
||||
|
||||
@@ -7,6 +7,7 @@ module Moderator
|
||||
@user = Factory.create(:user)
|
||||
CurrentUser.user = @user
|
||||
CurrentUser.ip_addr = "127.0.0.1"
|
||||
Danbooru.config.stubs(:member_comment_time_threshold).returns(1.week.from_now)
|
||||
Factory.create(:comment)
|
||||
MEMCACHE.flush_all
|
||||
end
|
||||
|
||||
@@ -54,6 +54,7 @@ class UserTest < ActiveSupport::TestCase
|
||||
end
|
||||
|
||||
should "limit comment votes" do
|
||||
Danbooru.config.stubs(:member_comment_time_threshold).returns(1.week.from_now)
|
||||
Danbooru.config.stubs(:member_comment_limit).returns(10)
|
||||
assert(@user.can_comment_vote?)
|
||||
10.times do
|
||||
|
||||
Reference in New Issue
Block a user