Travis CI compatiblity

This commit is contained in:
Karel Pičman 2015-04-01 17:47:52 +02:00
parent 7133a78a4c
commit bb2325acbd
3 changed files with 10 additions and 7 deletions

View File

@ -1,7 +1,7 @@
<%#
# Redmine plugin for Document Management System "Features"
#
# Copyright (C) 2011-14 Karel Picman <karel.picman@kontron.com>
# Copyright (C) 2011-15 Karel Picman <karel.picman@kontron.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@ -23,7 +23,8 @@
'dmsf_workflow_step_assignments.user_id = ? AND dmsf_workflow_step_actions.id IS NULL', @user.id).all %>
<% assignments = Array.new %>
<% all_assignments.each do |assignment| %>
<% if !assignment.dmsf_file_revision.file.last_revision.deleted &&
<% if assignment.dmsf_file_revision.file.last_revision &&
!assignment.dmsf_file_revision.file.last_revision.deleted &&
(assignment.dmsf_file_revision.workflow == DmsfWorkflow::STATE_WAITING_FOR_APPROVAL) &&
(assignment.dmsf_file_revision == assignment.dmsf_file_revision.file.last_revision) %>
<% assignments << assignment %>

View File

@ -1,8 +1,10 @@
# encoding: utf-8
#
# Redmine plugin for Document Management System "Features"
#
# Copyright (C) 2011 Vít Jonáš <vit.jonas@gmail.com>
# Copyright (C) 2012 Daniel Munn <dan.munn@munnster.co.uk>
# Copyright (C) 2011-14 Karel Pičman <karel.picman@kontron.com>
# Copyright (C) 2011-15 Karel Pičman <karel.picman@kontron.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@ -28,7 +30,7 @@ module RedmineDmsf
def self.fixtures(*table_names)
dir = File.join( File.dirname(__FILE__), '../../../test/fixtures')
table_names.each do |x|
ActiveRecord::Fixtures.create_fixtures(dir, x) if File.exist?("#{dir}/#{x}.yml")
ActiveRecord::FixtureSet.create_fixtures(dir, x) if File.exist?("#{dir}/#{x}.yml")
end
super(table_names)
end

View File

@ -155,10 +155,10 @@ class DmsfWorkflowsControllerTest < RedmineDmsf::Test::TestCase
def test_add_step
assert_difference 'DmsfWorkflowStep.count', +1 do
post :add_step, :commit => l(:dmsf_or), :step => 1, :id => @wf1.id, :user_ids =>[@user_non_member.id]
post :add_step, :commit => l(:dmsf_or), :step => 1, :id => @wf1.id, :user_ids => [@user_non_member.id]
end
assert_response :success
ws = DmsfWorkflowStep.first(:order => 'id DESC')
ws = DmsfWorkflowStep.order('id DESC').first
assert_equal @wf1.id, ws.dmsf_workflow_id
assert_equal 1, ws.step
assert_equal @user_non_member.id, ws.user_id
@ -171,7 +171,7 @@ class DmsfWorkflowsControllerTest < RedmineDmsf::Test::TestCase
delete :remove_step, :step => @wfs1.id, :id => @wf1.id
end
assert_response :success
ws = DmsfWorkflowStep.where(:dmsf_workflow_id => @wf1.id).first(:order => 'id ASC')
ws = DmsfWorkflowStep.where(:dmsf_workflow_id => @wf1.id).order('id ASC').first
assert_equal 1, ws.step
end