v1.5.9 tests
This commit is contained in:
parent
efc9368b60
commit
c1ed977985
@ -106,9 +106,9 @@ class DmsfFilesController < ApplicationController
|
||||
if version == 3
|
||||
revision.major_version = params[:custom_version_major].to_i
|
||||
revision.minor_version = params[:custom_version_minor].to_i
|
||||
else
|
||||
else
|
||||
revision.increase_version(version)
|
||||
end
|
||||
end
|
||||
file_upload = params[:dmsf_attachments]['1'] if params[:dmsf_attachments].present?
|
||||
unless file_upload
|
||||
revision.size = last_revision.size
|
||||
|
||||
@ -26,6 +26,12 @@ class DmsfLinksController < ApplicationController
|
||||
before_filter :find_link_project
|
||||
before_filter :authorize
|
||||
|
||||
def initialize
|
||||
@dmsf_link = nil
|
||||
@target_folder_id = nil
|
||||
super
|
||||
end
|
||||
|
||||
def new
|
||||
@dmsf_link = DmsfLink.new
|
||||
@dmsf_link.project_id = params[:project_id]
|
||||
|
||||
@ -28,6 +28,12 @@ class DmsfWorkflowsController < ApplicationController
|
||||
|
||||
layout :workflows_layout
|
||||
|
||||
def initialize
|
||||
@dmsf_workflow = nil
|
||||
@project = nil
|
||||
super
|
||||
end
|
||||
|
||||
def index
|
||||
@status = params[:status] || 1
|
||||
@workflow_pages, @workflows = paginate DmsfWorkflow.status(@status).global.sorted, :per_page => 25
|
||||
|
||||
@ -42,7 +42,7 @@ module DmsfWorkflowsHelper
|
||||
link_to text, autocomplete_for_user_dmsf_workflow_path(workflow, parameters.merge(:q => params[:q], :format => 'js')), :remote => true
|
||||
}
|
||||
|
||||
s + content_tag('p', links, :class => 'pagination')
|
||||
s += content_tag('p', links, :class => 'pagination')
|
||||
s.html_safe
|
||||
end
|
||||
|
||||
|
||||
@ -93,6 +93,11 @@ class DmsfFile < ActiveRecord::Base
|
||||
end
|
||||
end
|
||||
|
||||
def initialize
|
||||
@project = nil
|
||||
super
|
||||
end
|
||||
|
||||
@@storage_path = nil
|
||||
|
||||
def self.storage_path
|
||||
|
||||
@ -52,8 +52,6 @@ module RedmineDmsf
|
||||
issue = context[:issue]
|
||||
params = context[:params]
|
||||
uploaded_files = params[:dmsf_attachments]
|
||||
journal = params[:journal]
|
||||
uploads = []
|
||||
if uploaded_files && uploaded_files.is_a?(Hash)
|
||||
# standard file input uploads
|
||||
uploaded_files.each_value do |uploaded_file|
|
||||
|
||||
@ -29,10 +29,9 @@ module RedmineDmsf
|
||||
detail = context[:detail]
|
||||
case detail.property
|
||||
when 'dmsf_file'
|
||||
dmsf_file = detail.journal.journalized.dmsf_files.detect {|f| f.id == detail.prop_key.to_i}
|
||||
detail.prop_key = l(:label_document)
|
||||
detail.property = 'attachment'
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@ -26,7 +26,6 @@ module RedmineDmsf
|
||||
|
||||
def view_issues_form_details_bottom(context={})
|
||||
if context.is_a?(Hash) && context[:issue]
|
||||
issue = context[:issue]
|
||||
# Add Dmsf upload form
|
||||
html = "<div class=\"dmsf_uploader\">"
|
||||
html << '<p>'
|
||||
|
||||
@ -57,7 +57,7 @@ module RedmineDmsf
|
||||
|
||||
def self.init_testcache
|
||||
puts "Webdav::Cache: Enable MemoryStore cache."
|
||||
@@WebDAVCache = ActiveSupport::Cache::MemoryStore.new(options={:namespace => "RedmineDmsfWebDAV"})
|
||||
@@WebDAVCache = ActiveSupport::Cache::MemoryStore.new(:namespace => "RedmineDmsfWebDAV")
|
||||
end
|
||||
|
||||
def self.init_nullcache
|
||||
@ -75,7 +75,7 @@ module RedmineDmsf
|
||||
else
|
||||
# Create cache using the provided server address
|
||||
Rails.logger.info "Webdav::Cache: Cache enabled, using memcached server '#{Setting.plugin_redmine_dmsf['dmsf_memcached_servers']}'"
|
||||
@@WebDAVCache = ActiveSupport::Cache::MemCacheStore.new(Setting.plugin_redmine_dmsf['dmsf_memcached_servers'], options={:namespace => "RedmineDmsfWebDAV"})
|
||||
@@WebDAVCache = ActiveSupport::Cache::MemCacheStore.new(Setting.plugin_redmine_dmsf['dmsf_memcached_servers'])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@ -319,7 +319,7 @@ class DmsfWorkflowsControllerTest < RedmineDmsf::Test::TestCase
|
||||
:dmsf_file_revision_id => @revision2.id,
|
||||
:title => l(:title_waiting_for_approval))
|
||||
assert_response :success
|
||||
assert_match /ajax-modal/, response.body
|
||||
assert_match(/ajax-modal/, response.body)
|
||||
assert_template 'action'
|
||||
end
|
||||
|
||||
@ -349,7 +349,7 @@ class DmsfWorkflowsControllerTest < RedmineDmsf::Test::TestCase
|
||||
:dmsf_file_revision_id => @revision1.id,
|
||||
:title => l(:label_dmsf_wokflow_action_assign))
|
||||
assert_response :success
|
||||
assert_match /ajax-modal/, response.body
|
||||
assert_match(/ajax-modal/, response.body)
|
||||
assert_template 'assign'
|
||||
end
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user