fix tests

This commit is contained in:
r888888888
2014-11-07 15:03:00 -08:00
parent 233656fa17
commit 9a260eecb9
2 changed files with 7 additions and 3 deletions

View File

@@ -12,13 +12,17 @@ class CurrentUserTest < ActiveSupport::TestCase
context ".safe_mode?" do
should "return true if the host contains the string host" do
req = mock(:host => "safebooru")
req = mock()
req.stubs(:host).returns("safebooru")
req.stubs(:params).returns({})
CurrentUser.set_safe_mode(req)
assert_equal(true, CurrentUser.safe_mode?)
end
should "return false if the host does not contain the string host" do
req = mock(:host => "danbooru")
req = mock()
req.stubs(:host).returns("danbooru")
req.stubs(:params).returns({})
CurrentUser.set_safe_mode(req)
assert_equal(false, CurrentUser.safe_mode?)
end