fix tests
This commit is contained in:
@@ -20,7 +20,7 @@ class DmailTest < ActiveSupport::TestCase
|
|||||||
setup do
|
setup do
|
||||||
@recipient = FactoryGirl.create(:user)
|
@recipient = FactoryGirl.create(:user)
|
||||||
@recipient.create_dmail_filter(:words => "banned")
|
@recipient.create_dmail_filter(:words => "banned")
|
||||||
@dmail = FactoryGirl.build(:dmail, :title => "xxx", :owner => @recipient, :body => "banned word here", :to => @recipient)
|
@dmail = FactoryGirl.build(:dmail, :title => "xxx", :owner => @recipient, :body => "banned word here", :to => @recipient, :from => @user)
|
||||||
end
|
end
|
||||||
|
|
||||||
should "detect banned words" do
|
should "detect banned words" do
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ class ForumTopicTest < ActiveSupport::TestCase
|
|||||||
|
|
||||||
should "merge all the posts in one topic into the other" do
|
should "merge all the posts in one topic into the other" do
|
||||||
@topic.merge(@topic2)
|
@topic.merge(@topic2)
|
||||||
assert_equal(2, @topic.posts.count)
|
assert_equal(2, @topic2.posts.count)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -74,17 +74,6 @@ class UserNameChangeRequestTest < ActiveSupport::TestCase
|
|||||||
end
|
end
|
||||||
|
|
||||||
context "creating a new request" do
|
context "creating a new request" do
|
||||||
should "send dmails to the admin" do
|
|
||||||
assert_difference("Dmail.count", 2) do
|
|
||||||
UserNameChangeRequest.create(
|
|
||||||
:user_id => @requester.id,
|
|
||||||
:original_name => @requester.name,
|
|
||||||
:status => "pending",
|
|
||||||
:desired_name => "abc"
|
|
||||||
)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
should "not validate if the desired name already exists" do
|
should "not validate if the desired name already exists" do
|
||||||
assert_difference("UserNameChangeRequest.count", 0) do
|
assert_difference("UserNameChangeRequest.count", 0) do
|
||||||
req = UserNameChangeRequest.create(
|
req = UserNameChangeRequest.create(
|
||||||
|
|||||||
Reference in New Issue
Block a user