Commit d7ea9052f1ecc5add24ad8b9d0cb06082f28c86f
1 parent
035196e7
Exists in
master
and in
4 other branches
tests seed
Showing
3 changed files
with
10 additions
and
7 deletions
Show diff stats
db/fixtures/test/001_repo.rb
1 | -# Clone repo | |
2 | -`cp spec/seed_project.tar.gz /tmp/` | |
3 | -Dir.chdir("/tmp") | |
1 | +# Create dir for test repo | |
2 | +repo_dir = File.join(Rails.root, "tmp", "tests") | |
3 | +Dir.mkdir(repo_dir) unless File.exists?(repo_dir) | |
4 | + | |
5 | +`cp spec/seed_project.tar.gz tmp/tests/` | |
6 | +Dir.chdir(repo_dir) | |
4 | 7 | `tar -xf seed_project.tar.gz` |
5 | 8 | 3.times do |i| |
6 | -`cp -r /tmp/legit/ /tmp/legit_#{i}/` | |
7 | -puts "Unpacked seed repo - /tmp/legit_#{i}" | |
9 | +`cp -r legit/ legit_#{i}/` | |
10 | +puts "Unpacked seed repo - tmp/tests/legit_#{i}" | |
8 | 11 | end | ... | ... |
spec/models/project_spec.rb
... | ... | @@ -38,7 +38,7 @@ describe Project do |
38 | 38 | |
39 | 39 | it "should return path to repo" do |
40 | 40 | project = Project.new(:path => "somewhere") |
41 | - project.path_to_repo.should == "/tmp/somewhere" | |
41 | + project.path_to_repo.should == File.join(Rails.root, "tmp", "tests", "somewhere") | |
42 | 42 | end |
43 | 43 | |
44 | 44 | describe :valid_repo? do | ... | ... |