2 # This file is part of SMR.
4 # SMR is free software: you can redistribute it and/or modify it under the
5 # terms of the GNU General Public License as published by the Free Software
6 # Foundation, either version 3 of the License, or (at your option) any later
9 # SMR is distributed in the hope that it will be useful, but WITHOUT ANY
10 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License along with
14 # SMR. If not, see <http://www.gnu.org/licenses/>.
21 # Typical admin privileged session to test administrating things.
23 class AdminSessionTest < ActionDispatch::IntegrationTest
28 # try to login as privileged admin user
29 test "login as admin" do
30 # see if it takes us to the login page
32 assert_response :redirect, 'accessing / should redirect to /login'
34 assert_response :success
35 assert_equal new_session_path, path
37 smr_login(LOGIN, PASSWORD)
41 # manage (add, edit, delete) securities
42 test "manage securities" do
43 smr_login(LOGIN, PASSWORD)
45 get objects_security_index_path
46 assert_response :success
47 assert_not_nil assigns(:securities)
52 # manage (add, edit, delete) portfolios
53 test "manage portfolios" do
54 smr_login(LOGIN, PASSWORD)
56 get objects_portfolio_index_path
57 assert_response :success
58 assert_not_nil assigns(:portfolios)
63 # manage (add, edit, delete) FigureVar records
64 test "manage figures" do
65 smr_login(LOGIN, PASSWORD)
67 get objects_figurevar_index_path
68 assert_response :success
69 assert_not_nil assigns(:figurevars)
74 # manage (add, edit) User
76 smr_login(LOGIN, PASSWORD)
78 get objects_user_index_path
79 assert_response :success
80 assert_not_nil assigns(:users)
85 # manage (add, edit) Organization
86 test "manage organization" do
87 smr_login(LOGIN, PASSWORD)
89 get objects_organization_index_path
90 assert_response :success
91 assert_not_nil assigns(:organizations)