##// END OF EJS Templates
Remove some inline styling and some depreciated table cell attributes and replace them with proper class names....
Remove some inline styling and some depreciated table cell attributes and replace them with proper class names. Contributed by Andrew Smith. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9252 e93f8b46-1217-0410-a6f0-8f06a7374b81

File last commit:

r8847:e323a0c20c27
r9132:103cd46f7814
Show More
repository_filesystem_test.rb
84 lines | 3.0 KiB | text/x-ruby | RubyLexer
/ test / unit / repository_filesystem_test.rb
Toshi MARUYAMA
scm: filesystem: remove trailing white-spaces from unit model test....
r5583 # Redmine - project management software
# Copyright (C) 2006-2011 Jean-Philippe Lang
Jean-Philippe Lang
Adds Filesystem adapter (patch #1393 by Paul R)....
r1494 #
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
Toshi MARUYAMA
scm: filesystem: remove trailing white-spaces from unit model test....
r5583 #
Jean-Philippe Lang
Adds Filesystem adapter (patch #1393 by Paul R)....
r1494 # This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
Toshi MARUYAMA
scm: filesystem: remove trailing white-spaces from unit model test....
r5583 #
Jean-Philippe Lang
Adds Filesystem adapter (patch #1393 by Paul R)....
r1494 # You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Jean-Baptiste Barth
Use absolute paths in test/**/* requires for Ruby 1.9.2 compatibility. #4050...
r4395 require File.expand_path('../../test_helper', __FILE__)
Jean-Philippe Lang
Adds Filesystem adapter (patch #1393 by Paul R)....
r1494
Eric Davis
Upgraded to Rails 2.3.4 (#3597)...
r2773 class RepositoryFilesystemTest < ActiveSupport::TestCase
Jean-Philippe Lang
Adds Filesystem adapter (patch #1393 by Paul R)....
r1494 fixtures :projects
Toshi MARUYAMA
scm: filesystem: code clean up unit model test....
r5072
Toshi MARUYAMA
scm: filesystem: add test to override human_attribute_name of "Root directory"...
r8847 include Redmine::I18n
Toshi MARUYAMA
scm: filesystem: replace RAILS_ROOT to Rails.root in unit model test....
r5934 REPOSITORY_PATH = Rails.root.join('tmp/test/filesystem_repository').to_s
Toshi MARUYAMA
scm: filesystem: code clean up unit model test....
r5072
Jean-Philippe Lang
Adds Filesystem adapter (patch #1393 by Paul R)....
r1494 def setup
Toshi MARUYAMA
scm: filesystem: change project id of unit model test from 1 to 3....
r5073 @project = Project.find(3)
Jean-Philippe Lang
Adds Filesystem adapter (patch #1393 by Paul R)....
r1494 Setting.enabled_scm << 'Filesystem' unless Setting.enabled_scm.include?('Filesystem')
Toshi MARUYAMA
scm: filesystem: code clean up unit model test....
r5742 @repository = Repository::Filesystem.create(
:project => @project,
:url => REPOSITORY_PATH
)
assert @repository
Jean-Philippe Lang
Adds Filesystem adapter (patch #1393 by Paul R)....
r1494 end
Toshi MARUYAMA
scm: filesystem: code clean up unit model test....
r5072
Toshi MARUYAMA
scm: filesystem: add test to override human_attribute_name of "Root directory"...
r8847 def test_blank_root_directory_error_message
set_language_if_valid 'en'
repo = Repository::Filesystem.new(
:project => @project,
:identifier => 'test'
)
assert !repo.save
assert_include "Root directory can't be blank",
repo.errors.full_messages
end
def test_blank_root_directory_error_message_fr
set_language_if_valid 'fr'
str = "R\xc3\xa9pertoire racine doit \xc3\xaatre renseign\xc3\xa9(e)"
str.force_encoding('UTF-8') if str.respond_to?(:force_encoding)
repo = Repository::Filesystem.new(
:project => @project,
:url => "",
:identifier => 'test',
:path_encoding => ''
)
assert !repo.save
assert_include str, repo.errors.full_messages
end
Toshi MARUYAMA
scm: filesystem: remove trailing white-spaces from unit model test....
r5583 if File.directory?(REPOSITORY_PATH)
Jean-Philippe Lang
Adds Filesystem adapter (patch #1393 by Paul R)....
r1494 def test_fetch_changesets
Toshi MARUYAMA
Rails3: scm: filesystem: replace @repository.reload to @project.reload of test_fetch_changesets at unit model test...
r7044 assert_equal 0, @repository.changesets.count
assert_equal 0, @repository.changes.count
Jean-Philippe Lang
Adds Filesystem adapter (patch #1393 by Paul R)....
r1494 @repository.fetch_changesets
Toshi MARUYAMA
Rails3: scm: filesystem: replace @repository.reload to @project.reload of test_fetch_changesets at unit model test...
r7044 @project.reload
Jean-Philippe Lang
Adds Filesystem adapter (patch #1393 by Paul R)....
r1494 assert_equal 0, @repository.changesets.count
assert_equal 0, @repository.changes.count
end
Toshi MARUYAMA
scm: filesystem: code clean up unit model test....
r5072
Jean-Philippe Lang
Adds Filesystem adapter (patch #1393 by Paul R)....
r1494 def test_entries
Toshi MARUYAMA
scm: filesystem: update test repository for non ascii text files displaying (#6256)....
r5083 assert_equal 3, @repository.entries("", 2).size
Jean-Philippe Lang
Adds Filesystem adapter (patch #1393 by Paul R)....
r1494 assert_equal 2, @repository.entries("dir", 3).size
end
def test_cat
assert_equal "TEST CAT\n", @repository.scm.cat("test")
end
else
puts "Filesystem test repository NOT FOUND. Skipping unit tests !!! See doc/RUNNING_TESTS."
def test_fake; assert true end
end
end