def test_commit_referencing_a_parent_project_issue
# repository of child project
- r = Repository::Subversion.create!(
- :project => Project.find(3),
- :url => 'svn://localhost/test')
+ r = Repository::Subversion.
+ create!(
+ :project => Project.find(3),
+ :url => 'svn://localhost/test'
+ )
c = Changeset.new(:repository => r,
:committed_on => Time.now,
:comments => 'refs #2, an issue of a parent project',
end
def test_commit_referencing_a_project_with_commit_cross_project_ref_disabled
- r = Repository::Subversion.create!(
- :project => Project.find(3),
- :url => 'svn://localhost/test')
+ r = Repository::Subversion.
+ create!(
+ :project => Project.find(3),
+ :url => 'svn://localhost/test'
+ )
with_settings :commit_cross_project_ref => '0' do
c = Changeset.new(:repository => r,
:committed_on => Time.now,
end
def test_commit_referencing_a_project_with_commit_cross_project_ref_enabled
- r = Repository::Subversion.create!(
- :project => Project.find(3),
- :url => 'svn://localhost/test')
+ r = Repository::Subversion.
+ create!(
+ :project => Project.find(3),
+ :url => 'svn://localhost/test'
+ )
with_settings :commit_cross_project_ref => '1' do
c = Changeset.new(:repository => r,
:committed_on => Time.now,
end
def test_text_tag_revision_with_repository_identifier
- r = Repository::Subversion.create!(
- :project_id => 1,
- :url => 'svn://localhost/test',
- :identifier => 'documents')
+ r = Repository::Subversion.
+ create!(
+ :project_id => 1,
+ :url => 'svn://localhost/test',
+ :identifier => 'documents'
+ )
c = Changeset.new(:revision => '520', :repository => r)
assert_equal 'documents|r520', c.text_tag
assert_equal 'ecookbook:documents|r520', c.text_tag(Project.find(2))
end
def test_text_tag_hash
- c = Changeset.new(
- :scmid => '7234cb2750b63f47bff735edc50a1c0a433c2518',
- :revision => '7234cb2750b63f47bff735edc50a1c0a433c2518')
+ c = Changeset.
+ new(
+ :scmid => '7234cb2750b63f47bff735edc50a1c0a433c2518',
+ :revision => '7234cb2750b63f47bff735edc50a1c0a433c2518'
+ )
assert_equal 'commit:7234cb2750b63f47bff735edc50a1c0a433c2518', c.text_tag
end
end
def test_text_tag_hash_with_repository_identifier
- r = Repository::Subversion.new(
+ r =
+ Repository::Subversion.
+ new(
:project_id => 1,
:url => 'svn://localhost/test',
- :identifier => 'documents')
+ :identifier => 'documents'
+ )
c = Changeset.new(:revision => '7234cb27', :scmid => '7234cb27', :repository => r)
assert_equal 'commit:documents|7234cb27', c.text_tag
assert_equal 'ecookbook:commit:documents|7234cb27', c.text_tag(Project.find(2))
def test_comments_should_be_converted_to_utf8
proj = Project.find(3)
str = "Texte encod\xe9 en ISO-8859-1.".b
- r = Repository::Bazaar.create!(
+ r = Repository::Bazaar.
+ create!(
:project => proj,
:url => '/tmp/test/bazaar',
- :log_encoding => 'ISO-8859-1' )
+ :log_encoding => 'ISO-8859-1'
+ )
assert r
c = Changeset.new(:repository => r,
:committed_on => Time.now,
def test_invalid_utf8_sequences_in_comments_should_be_replaced_latin1
proj = Project.find(3)
str2 = "\xe9a\xe9b\xe9c\xe9d\xe9e test".b
- r = Repository::Bazaar.create!(
+ r = Repository::Bazaar.
+ create!(
:project => proj,
:url => '/tmp/test/bazaar',
- :log_encoding => 'UTF-8' )
+ :log_encoding => 'UTF-8'
+ )
assert r
c = Changeset.new(:repository => r,
:committed_on => Time.now,
def test_invalid_utf8_sequences_in_comments_should_be_replaced_ja_jis
proj = Project.find(3)
str = "test\xb5\xfetest\xb5\xfe".b
- r = Repository::Bazaar.create!(
+ r = Repository::Bazaar.
+ create!(
:project => proj,
:url => '/tmp/test/bazaar',
- :log_encoding => 'ISO-2022-JP' )
+ :log_encoding => 'ISO-2022-JP'
+ )
assert r
c = Changeset.new(:repository => r,
:committed_on => Time.now,
s4.force_encoding('UTF-8')
assert_equal s3.encode('UTF-8'), s4
proj = Project.find(3)
- r = Repository::Bazaar.create!(
+ r = Repository::Bazaar.
+ create!(
:project => proj,
:url => '/tmp/test/bazaar',
- :log_encoding => 'ISO-8859-1' )
+ :log_encoding => 'ISO-8859-1'
+ )
assert r
c = Changeset.new(:repository => r,
:committed_on => Time.now,
def test_invalid_utf8_sequences_in_paths_should_be_replaced
proj = Project.find(3)
str2 = "\xe9a\xe9b\xe9c\xe9d\xe9e test".b
- r = Repository::Bazaar.create!(
+ r = Repository::Bazaar.
+ create!(
:project => proj,
:url => '/tmp/test/bazaar',
- :log_encoding => 'UTF-8' )
+ :log_encoding => 'UTF-8'
+ )
assert r
- cs = Changeset.new(
- :repository => r,
- :committed_on => Time.now,
- :revision => '123',
- :scmid => '12345',
- :comments => "test")
+ cs = Changeset.
+ new(
+ :repository => r,
+ :committed_on => Time.now,
+ :revision => '123',
+ :scmid => '12345',
+ :comments => "test"
+ )
assert(cs.save)
- ch = Change.new(
- :changeset => cs,
- :action => "A",
- :path => "Texte encod\xE9 en ISO-8859-1",
- :from_path => str2,
- :from_revision => "345")
+ ch = Change.
+ new(
+ :changeset => cs,
+ :action => "A",
+ :path => "Texte encod\xE9 en ISO-8859-1",
+ :from_path => str2,
+ :from_revision => "345"
+ )
assert(ch.save)
assert_equal "Texte encod? en ISO-8859-1", ch.path
assert_equal "?a?b?c?d?e test", ch.from_path
def test_comments_nil
proj = Project.find(3)
- r = Repository::Bazaar.create!(
+ r = Repository::Bazaar.
+ create!(
:project => proj,
:url => '/tmp/test/bazaar',
- :log_encoding => 'ISO-8859-1' )
+ :log_encoding => 'ISO-8859-1'
+ )
assert r
c = Changeset.new(:repository => r,
:committed_on => Time.now,
def test_comments_empty
proj = Project.find(3)
- r = Repository::Bazaar.create!(
+ r = Repository::Bazaar.
+ create!(
:project => proj,
:url => '/tmp/test/bazaar',
- :log_encoding => 'ISO-8859-1' )
+ :log_encoding => 'ISO-8859-1'
+ )
assert r
c = Changeset.new(:repository => r,
:committed_on => Time.now,