ソースを参照

Merged r13390 (#17163).

git-svn-id: http://svn.redmine.org/redmine/branches/2.5-stable@13397 e93f8b46-1217-0410-a6f0-8f06a7374b81
tags/2.5.3
Jean-Philippe Lang 9年前
コミット
198e92d26b
2個のファイルの変更14行の追加0行の削除
  1. 4
    0
      app/models/version.rb
  2. 10
    0
      test/functional/attachments_controller_test.rb

+ 4
- 0
app/models/version.rb ファイルの表示

@@ -60,6 +60,10 @@ class Version < ActiveRecord::Base
project.present? && project.attachments_visible?(*args)
end

def attachments_deletable?(usr=User.current)
project.present? && project.attachments_deletable?(usr)
end

def start_date
@start_date ||= fixed_issues.minimum('start_date')
end

+ 10
- 0
test/functional/attachments_controller_test.rb ファイルの表示

@@ -374,6 +374,16 @@ class AttachmentsControllerTest < ActionController::TestCase
end
end

def test_destroy_version_attachment_with_issue_tracking_disabled
Project.find(1).disable_module! :issue_tracking
set_tmp_attachments_directory
@request.session[:user_id] = 2
assert_difference 'Attachment.count', -1 do
delete :destroy, :id => 9
assert_response 302
end
end

def test_destroy_without_permission
set_tmp_attachments_directory
assert_no_difference 'Attachment.count' do

読み込み中…
キャンセル
保存