blob: f5f144611f409a5f7241abacf7372272b5f1b94d (
plain)
| 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
 | require 'test_helper'
class AccountControllerTest < ActionController::TestCase
  test "should get new" do
    get :new
    assert_equal User, assigns(:user).class
    assert_response :success
  end
  test "new should redirect logged in users" do
    login
    get :new
    assert_response :redirect
    assert_redirected_to home_path
  end
  test "new redirects if registration is closed" do
    with_config(allow_registration: false) do
      get :new
      assert_response :redirect
      assert_redirected_to home_path
    end
  end
end
 |