Check that a request that requires authentication is redirected when the user hasn't seen the terms
This commit is contained in:
parent
4deffa5e40
commit
d7f41756f9
1 changed files with 11 additions and 0 deletions
|
@ -671,6 +671,17 @@ class UsersControllerTest < ActionController::TestCase
|
|||
assert_equal true, user.terms_seen
|
||||
end
|
||||
|
||||
# Check that if you haven't seen the terms, and make a request that requires authentication,
|
||||
# that your request is redirected to view the terms
|
||||
def test_terms_not_seen_redirection
|
||||
user = create(:user, :terms_seen => false)
|
||||
session[:user] = user.id
|
||||
|
||||
get :account, :params => { :display_name => user.display_name }
|
||||
assert_response :redirect
|
||||
assert_redirected_to :action => :terms, :referer => "/user/#{ERB::Util.u(user.display_name)}/account"
|
||||
end
|
||||
|
||||
def test_go_public
|
||||
user = create(:user, :data_public => false)
|
||||
post :go_public, :session => { :user => user }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue