fix tests and typo bugs

This commit is contained in:
albert
2013-03-22 18:54:37 -04:00
parent ec50911a52
commit a4b67fa072
9 changed files with 53 additions and 68 deletions

View File

@@ -19,6 +19,14 @@ FactoryGirl.define do
level 30
end
factory(:platinum_user) do
level 31
end
factory(:builder_user) do
level 32
end
factory(:contributor_user) do
level 33
end

View File

@@ -3,7 +3,7 @@ require 'test_helper'
class TagsControllerTest < ActionController::TestCase
context "The tags controller" do
setup do
@user = FactoryGirl.create(:user)
@user = FactoryGirl.create(:builder_user)
CurrentUser.user = @user
CurrentUser.ip_addr = "127.0.0.1"
end

View File

@@ -32,7 +32,7 @@ class UploadTest < ActiveSupport::TestCase
should "fail creation" do
@upload = FactoryGirl.build(:jpg_upload, :tag_string => "")
@upload.save
assert_equal(["You can only upload 0 posts a day"], @upload.errors.full_messages)
assert_equal(["You can not upload until your pending posts have been approved"], @upload.errors.full_messages)
end
end

View File

@@ -39,22 +39,6 @@ class UserTest < ActiveSupport::TestCase
end
end
context "who has negeative feedback and is trying to change their name" do
setup do
@mod = FactoryGirl.create(:moderator_user)
CurrentUser.scoped(@mod, "127.0.0.1") do
FactoryGirl.create(:user_feedback, :user => @user, :category => "negative")
end
end
should "not validate" do
@user.reload
@user.update_attributes(:name => "fanfarlo")
assert_equal(["You can not change your name if you have any negative feedback"], @user.errors.full_messages)
end
end
should "not validate if the originating ip address is banned" do
FactoryGirl.create(:ip_ban)
user = FactoryGirl.build(:user)