Skip to content

Commit 8f4ab38

Browse files
author
root
committed
Use sequence to generate urls and git config keys
1 parent 506e395 commit 8f4ab38

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

spec/factories/repository_git_config_key.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
FactoryGirl.define do
22

33
factory :repository_git_config_key do |git_config_key|
4-
git_config_key.key 'hookfoo.foo'
4+
git_config_key.sequence(:key) { |n| "hookfoo.foo#{n}" }
55
git_config_key.value 'bar'
66
end
77

spec/factories/repository_mirror.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
FactoryGirl.define do
22

33
factory :repository_mirror do |mirror|
4-
mirror.url 'ssh://host.xz/path/to/repo.git'
4+
mirror.sequence(:url) { |n| "ssh://host.xz/path/to/repo#{n}.git" }
55
mirror.push_mode 0
66
end
77

Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
FactoryGirl.define do
22

33
factory :repository_post_receive_url do |post_receive_url|
4-
post_receive_url.url 'http://example.com/toto.php'
4+
post_receive_url.sequence(:url) { |n| "http://example.com/toto#{n}.php" }
55
end
66

77
end

spec/factories/user.rb

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
FactoryGirl.define do
22

33
factory :user do |user|
4-
user.sequence(:login) { |n| "user#{n}"}
5-
user.sequence(:firstname) { |n| "User#{n}"}
6-
user.sequence(:lastname) { |n| "Test#{n}"}
7-
user.sequence(:mail) { |n| "user#{n}@awesome.com"}
4+
user.sequence(:login) { |n| "user#{n}" }
5+
user.sequence(:firstname) { |n| "User#{n}" }
6+
user.sequence(:lastname) { |n| "Test#{n}" }
7+
user.sequence(:mail) { |n| "user#{n}@awesome.com" }
88
user.language "fr"
99
user.hashed_password "66eb4812e268747f89ec309178e2ea50410653fb"
1010
user.salt "5abd4e59ac0d483daf2f68d3b6544ff3"

spec/models/repository_mirror_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
before do
66
@project = FactoryGirl.create(:project)
77
@repository_git = FactoryGirl.create(:repository, :project_id => @project.id)
8-
@mirror = FactoryGirl.build(:repository_mirror, :repository_id => @repository_git.id)
8+
@mirror = FactoryGirl.build(:repository_mirror, :repository_id => @repository_git.id, :url => "ssh://host.xz/path/to/repo.git")
99
end
1010

1111
subject { @mirror }

0 commit comments

Comments
 (0)