3 class RepositoryTest < ActiveSupport::TestCase
4 test 'write permission allows changing modified_at' do
5 act_as_user users(:active) do
7 modtime_was = r.modified_at
8 r.modified_at = Time.now
10 assert_operator modtime_was, :<, r.modified_at
14 test 'write permission not sufficient for changing name' do
15 act_as_user users(:active) do
16 r = repositories(:foo)
19 assert_raises ArvadosModel::PermissionDeniedError do
23 assert_equal name_was, r.name
27 test 'write permission necessary for changing modified_at' do
28 act_as_user users(:spectator) do
29 r = repositories(:foo)
30 modtime_was = r.modified_at
31 r.modified_at = Time.now
32 assert_raises ArvadosModel::PermissionDeniedError do
36 assert_equal modtime_was, r.modified_at