mirror of
https://github.com/redmine/redmine.git
synced 2025-11-15 17:56:03 +01:00
cleanup: rubocop: fix Layout/IndentFirstArgument in test/unit/repository_test.rb
git-svn-id: http://svn.redmine.org/redmine/trunk@19224 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -48,7 +48,9 @@ class RepositoryTest < ActiveSupport::TestCase
|
||||
|
||||
def test_blank_log_encoding_error_message
|
||||
set_language_if_valid 'en'
|
||||
repo = Repository::Bazaar.new(
|
||||
repo =
|
||||
Repository::Bazaar.
|
||||
new(
|
||||
:project => Project.find(3),
|
||||
:url => "/test",
|
||||
:log_encoding => ''
|
||||
@@ -60,7 +62,9 @@ class RepositoryTest < ActiveSupport::TestCase
|
||||
|
||||
def test_blank_log_encoding_error_message_fr
|
||||
set_language_if_valid 'fr'
|
||||
repo = Repository::Bazaar.new(
|
||||
repo =
|
||||
Repository::Bazaar.
|
||||
new(
|
||||
:project => Project.find(3),
|
||||
:url => "/test"
|
||||
)
|
||||
@@ -111,7 +115,9 @@ class RepositoryTest < ActiveSupport::TestCase
|
||||
end
|
||||
|
||||
def test_first_repository_should_be_set_as_default
|
||||
repository1 = Repository::Subversion.new(
|
||||
repository1 =
|
||||
Repository::Subversion.
|
||||
new(
|
||||
:project => Project.find(3),
|
||||
:identifier => 'svn1',
|
||||
:url => 'file:///svn1'
|
||||
@@ -119,7 +125,9 @@ class RepositoryTest < ActiveSupport::TestCase
|
||||
assert repository1.save
|
||||
assert repository1.is_default?
|
||||
|
||||
repository2 = Repository::Subversion.new(
|
||||
repository2 =
|
||||
Repository::Subversion.
|
||||
new(
|
||||
:project => Project.find(3),
|
||||
:identifier => 'svn2',
|
||||
:url => 'file:///svn2'
|
||||
@@ -133,7 +141,9 @@ class RepositoryTest < ActiveSupport::TestCase
|
||||
|
||||
def test_default_repository_should_be_one
|
||||
assert_equal 0, Project.find(3).repositories.count
|
||||
repository1 = Repository::Subversion.new(
|
||||
repository1 =
|
||||
Repository::Subversion.
|
||||
new(
|
||||
:project => Project.find(3),
|
||||
:identifier => 'svn1',
|
||||
:url => 'file:///svn1'
|
||||
@@ -141,7 +151,9 @@ class RepositoryTest < ActiveSupport::TestCase
|
||||
assert repository1.save
|
||||
assert repository1.is_default?
|
||||
|
||||
repository2 = Repository::Subversion.new(
|
||||
repository2 =
|
||||
Repository::Subversion.
|
||||
new(
|
||||
:project => Project.find(3),
|
||||
:identifier => 'svn2',
|
||||
:url => 'file:///svn2',
|
||||
@@ -157,7 +169,9 @@ class RepositoryTest < ActiveSupport::TestCase
|
||||
end
|
||||
|
||||
def test_identifier_should_accept_letters_digits_dashes_and_underscores
|
||||
r = Repository::Subversion.new(
|
||||
r =
|
||||
Repository::Subversion.
|
||||
new(
|
||||
:project_id => 3,
|
||||
:identifier => 'svn-123_45',
|
||||
:url => 'file:///svn'
|
||||
@@ -226,8 +240,12 @@ class RepositoryTest < ActiveSupport::TestCase
|
||||
def test_should_not_create_with_disabled_scm
|
||||
# disable Subversion
|
||||
with_settings :enabled_scm => ['Mercurial', 'Git'] do
|
||||
repository = Repository::Subversion.new(
|
||||
:project => Project.find(3), :url => "svn://localhost")
|
||||
repository =
|
||||
Repository::Subversion.
|
||||
new(
|
||||
:project => Project.find(3),
|
||||
:url => "svn://localhost"
|
||||
)
|
||||
assert !repository.save
|
||||
assert_include I18n.translate('activerecord.errors.messages.invalid'),
|
||||
repository.errors[:type]
|
||||
@@ -271,9 +289,11 @@ class RepositoryTest < ActiveSupport::TestCase
|
||||
ActionMailer::Base.deliveries.first(2).each do |mail|
|
||||
assert_not_nil mail
|
||||
assert mail.subject.starts_with?(
|
||||
"[#{fixed_issue.project.name} - #{fixed_issue.tracker.name} ##{fixed_issue.id}]")
|
||||
"[#{fixed_issue.project.name} - #{fixed_issue.tracker.name} ##{fixed_issue.id}]"
|
||||
)
|
||||
assert_mail_body_match(
|
||||
"Status changed from #{old_status} to #{fixed_issue.status}", mail)
|
||||
"Status changed from #{old_status} to #{fixed_issue.status}", mail
|
||||
)
|
||||
end
|
||||
|
||||
# ignoring commits referencing an issue of another project
|
||||
@@ -281,9 +301,12 @@ class RepositoryTest < ActiveSupport::TestCase
|
||||
end
|
||||
|
||||
def test_for_changeset_comments_strip
|
||||
repository = Repository::Mercurial.create(
|
||||
repository =
|
||||
Repository::Mercurial.
|
||||
create(
|
||||
:project => Project.find(4),
|
||||
:url => '/foo/bar/baz' )
|
||||
:url => '/foo/bar/baz'
|
||||
)
|
||||
long_whitespace = " "
|
||||
expected_comment = "This is a loooooooooooooooooooooooooooong comment"
|
||||
comment = +"#{expected_comment}#{long_whitespace}\n"
|
||||
@@ -301,11 +324,14 @@ class RepositoryTest < ActiveSupport::TestCase
|
||||
end
|
||||
|
||||
def test_for_urls_strip_cvs
|
||||
repository = Repository::Cvs.create(
|
||||
repository =
|
||||
Repository::Cvs.
|
||||
create(
|
||||
:project => Project.find(4),
|
||||
:url => ' :pserver:login:password@host:/path/to/the/repository',
|
||||
:root_url => 'foo ',
|
||||
:log_encoding => 'UTF-8')
|
||||
:log_encoding => 'UTF-8'
|
||||
)
|
||||
assert repository.save
|
||||
repository.reload
|
||||
assert_equal ':pserver:login:password@host:/path/to/the/repository',
|
||||
@@ -314,18 +340,24 @@ class RepositoryTest < ActiveSupport::TestCase
|
||||
end
|
||||
|
||||
def test_for_urls_strip_subversion
|
||||
repository = Repository::Subversion.create(
|
||||
repository =
|
||||
Repository::Subversion.
|
||||
create(
|
||||
:project => Project.find(4),
|
||||
:url => ' file:///dummy ')
|
||||
:url => ' file:///dummy '
|
||||
)
|
||||
assert repository.save
|
||||
repository.reload
|
||||
assert_equal 'file:///dummy', repository.url
|
||||
end
|
||||
|
||||
def test_for_urls_strip_git
|
||||
repository = Repository::Git.create(
|
||||
repository =
|
||||
Repository::Git.
|
||||
create(
|
||||
:project => Project.find(4),
|
||||
:url => ' c:\dummy ')
|
||||
:url => ' c:\dummy '
|
||||
)
|
||||
assert repository.save
|
||||
repository.reload
|
||||
assert_equal 'c:\dummy', repository.url
|
||||
@@ -333,7 +365,8 @@ class RepositoryTest < ActiveSupport::TestCase
|
||||
|
||||
def test_manual_user_mapping
|
||||
assert_no_difference "Changeset.where('user_id <> 2').count" do
|
||||
c = Changeset.create!(
|
||||
c = Changeset.
|
||||
create!(
|
||||
:repository => @repository,
|
||||
:committer => 'foo',
|
||||
:committed_on => Time.now,
|
||||
@@ -344,7 +377,8 @@ class RepositoryTest < ActiveSupport::TestCase
|
||||
@repository.committer_ids = {'foo' => '2'}
|
||||
assert_equal User.find(2), c.reload.user
|
||||
# committer is now mapped
|
||||
c = Changeset.create!(
|
||||
c = Changeset.
|
||||
create!(
|
||||
:repository => @repository,
|
||||
:committer => 'foo',
|
||||
:committed_on => Time.now,
|
||||
@@ -356,7 +390,8 @@ class RepositoryTest < ActiveSupport::TestCase
|
||||
end
|
||||
|
||||
def test_auto_user_mapping_by_username
|
||||
c = Changeset.create!(
|
||||
c = Changeset.
|
||||
create!(
|
||||
:repository => @repository,
|
||||
:committer => 'jsmith',
|
||||
:committed_on => Time.now,
|
||||
@@ -367,7 +402,8 @@ class RepositoryTest < ActiveSupport::TestCase
|
||||
end
|
||||
|
||||
def test_auto_user_mapping_by_email
|
||||
c = Changeset.create!(
|
||||
c = Changeset.
|
||||
create!(
|
||||
:repository => @repository,
|
||||
:committer => 'john <jsmith@somenet.foo>',
|
||||
:committed_on => Time.now,
|
||||
|
||||
Reference in New Issue
Block a user