fix tests
This commit is contained in:
@@ -12,7 +12,7 @@
|
|||||||
<% if CurrentUser.user.is_gold? %>
|
<% if CurrentUser.user.is_gold? %>
|
||||||
<p><%= link_to "Request a name change", new_user_name_change_request_path %></p>
|
<p><%= link_to "Request a name change", new_user_name_change_request_path %></p>
|
||||||
<% else %>
|
<% else %>
|
||||||
<p>You must <%= link_to "upgrade your account", upgrade_information_users_path %> to request a name change</p>
|
<p>You must <%= link_to "upgrade your account", new_user_upgrade_path %> to request a name change</p>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -12,13 +12,17 @@ class CurrentUserTest < ActiveSupport::TestCase
|
|||||||
|
|
||||||
context ".safe_mode?" do
|
context ".safe_mode?" do
|
||||||
should "return true if the host contains the string host" 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)
|
CurrentUser.set_safe_mode(req)
|
||||||
assert_equal(true, CurrentUser.safe_mode?)
|
assert_equal(true, CurrentUser.safe_mode?)
|
||||||
end
|
end
|
||||||
|
|
||||||
should "return false if the host does not contain the string host" do
|
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)
|
CurrentUser.set_safe_mode(req)
|
||||||
assert_equal(false, CurrentUser.safe_mode?)
|
assert_equal(false, CurrentUser.safe_mode?)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user