Skip to content

Commit 460f7cc

Browse files
author
root
committed
Run Gitolite repo creation tests independantly
1 parent 9e4c296 commit 460f7cc

File tree

1 file changed

+26
-15
lines changed

1 file changed

+26
-15
lines changed

spec/models/repository_git_spec.rb

+26-15
Original file line numberDiff line numberDiff line change
@@ -1028,26 +1028,37 @@ def collection_of_non_unique_repositories
10281028

10291029

10301030
describe "Gitolite specific tests" do
1031-
before do
1032-
Setting.plugin_redmine_git_hosting[:hierarchical_organisation] = 'true'
1033-
Setting.plugin_redmine_git_hosting[:unique_repo_identifier] = 'false'
1034-
1035-
@foo = create_git_repository(:project => @project_child, :identifier => 'foo')
1036-
@bar = create_git_repository(:project => @project_child, :identifier => 'bar')
1031+
describe "repo foo" do
1032+
before do
1033+
Setting.plugin_redmine_git_hosting[:hierarchical_organisation] = 'true'
1034+
Setting.plugin_redmine_git_hosting[:unique_repo_identifier] = 'false'
10371035

1038-
RedmineGitolite::GitHosting.resync_gitolite(:add_repository, @foo.id, :create_readme_file => true)
1039-
RedmineGitolite::GitHosting.resync_gitolite(:add_repository, @bar.id, :create_readme_file => false)
1036+
@foo = create_git_repository(:project => @project_child, :identifier => 'foo')
1037+
RedmineGitolite::GitHosting.resync_gitolite(:add_repository, @foo.id, :create_readme_file => true)
1038+
@foo.fetch_changesets
1039+
end
10401040

1041-
@foo.fetch_changesets
1042-
@bar.fetch_changesets
1041+
it "should create repositories" do
1042+
expect(@foo.exists_in_gitolite?).to be true
1043+
expect(@foo.empty?).to be false
1044+
end
10431045
end
10441046

1045-
it "should create repositories" do
1046-
expect(@foo.exists_in_gitolite?).to be true
1047-
expect(@foo.empty?).to be false
1047+
describe "repo bar" do
1048+
before do
1049+
Setting.plugin_redmine_git_hosting[:hierarchical_organisation] = 'true'
1050+
Setting.plugin_redmine_git_hosting[:unique_repo_identifier] = 'false'
1051+
1052+
@bar = create_git_repository(:project => @project_child, :identifier => 'bar')
1053+
RedmineGitolite::GitHosting.resync_gitolite(:add_repository, @bar.id, :create_readme_file => false)
1054+
@bar.fetch_changesets
1055+
end
10481056

1049-
expect(@bar.exists_in_gitolite?).to be true
1050-
expect(@bar.empty?).to be true
1057+
it "should create repositories" do
1058+
expect(@bar.exists_in_gitolite?).to be true
1059+
expect(@bar.empty?).to be true
1060+
end
10511061
end
1062+
10521063
end
10531064
end

0 commit comments

Comments
 (0)