commit
aed57c6c0a
@ -0,0 +1,17 @@
|
||||
<% if @save_flag %>
|
||||
window.location.reload();
|
||||
<% else %>
|
||||
// alert('添加文件失败:\n<%=@save_message[0]%>');
|
||||
$('#ajax-modal').html('<h3 class="title">添加文件失败</h3><%=@save_message.join(', ')%>');
|
||||
|
||||
var el = $('#ajax-modal').first();
|
||||
var title = el.find('h3.title').text();
|
||||
el.dialog({
|
||||
width: '200px',
|
||||
modal: true,
|
||||
resizable: false,
|
||||
dialogClass: 'modal',
|
||||
title: title
|
||||
});
|
||||
|
||||
<% end %>
|
@ -0,0 +1,2 @@
|
||||
$('#relation_file_form').show();
|
||||
$('#relation_file').html('<%=render_attachments_for_new_project(@project, nil)%>');
|
@ -0,0 +1,20 @@
|
||||
# encoding: utf-8
|
||||
require 'test_helper'
|
||||
|
||||
class AttachmentsTest < ActiveSupport::TestCase
|
||||
include AttachmentsHelper
|
||||
|
||||
def setup
|
||||
@file_belong_to = attachments(:attachments_021)
|
||||
@file_not_belong_to = attachments(:attachments_022)
|
||||
@project = @file_belong_to.container
|
||||
end
|
||||
|
||||
test "can be find file not belong to project" do
|
||||
params = {:q => @file_not_belong_to}
|
||||
found_file = render_attachments_for_new_project(@project)
|
||||
assert found_file.include?(@file_not_belong_to)
|
||||
assert_not found_file.include?(@file_belong_to)
|
||||
end
|
||||
|
||||
end
|
Loading…
Reference in new issue