diff options
| author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-03-12 14:39:26 +0000 |
|---|---|---|
| committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-03-12 14:39:26 +0000 |
| commit | 0f4ad24ff2f3ff375153b2e6535f1fd2ca467401 (patch) | |
| tree | 1a4378fb5f372b4fc1e7e7a7fc0a16b687ab89b9 /spec/gitlab_projects_spec.rb | |
| parent | d207d69ba2d74856b81f8c88159cdcdde36d37ca (diff) | |
| parent | 323545fc87a5527867b9f276d8efc29a27a1468d (diff) | |
| download | gitlab-shell-1.8.3.tar.gz | |
Merge branch 'import-timeout' into 'master'v1.8.3
Import Timeout
Diffstat (limited to 'spec/gitlab_projects_spec.rb')
| -rw-r--r-- | spec/gitlab_projects_spec.rb | 37 |
1 files changed, 29 insertions, 8 deletions
diff --git a/spec/gitlab_projects_spec.rb b/spec/gitlab_projects_spec.rb index dbdbfd9..c60febb 100644 --- a/spec/gitlab_projects_spec.rb +++ b/spec/gitlab_projects_spec.rb @@ -196,17 +196,38 @@ describe GitlabProjects do end describe :import_project do - let(:gl_projects) { build_gitlab_projects('import-project', repo_name, 'https://github.com/randx/six.git') } + context 'success import' do + let(:gl_projects) { build_gitlab_projects('import-project', repo_name, 'https://github.com/randx/six.git') } - it "should import a repo" do - gl_projects.exec - File.exists?(File.join(tmp_repo_path, 'HEAD')).should be_true + it { gl_projects.exec.should be_true } + + it "should import a repo" do + gl_projects.exec + File.exists?(File.join(tmp_repo_path, 'HEAD')).should be_true + end + + it "should log an import-project event" do + message = "Importing project #{repo_name} from <https://github.com/randx/six.git> to <#{tmp_repo_path}>." + $logger.should_receive(:info).with(message) + gl_projects.exec + end end - it "should log an import-project event" do - message = "Importing project #{repo_name} from <https://github.com/randx/six.git> to <#{tmp_repo_path}>." - $logger.should_receive(:info).with(message) - gl_projects.exec + context 'timeout' do + let(:gl_projects) { build_gitlab_projects('import-project', repo_name, 'https://github.com/gitlabhq/gitlabhq.git', '1') } + + it { gl_projects.exec.should be_false } + + it "should not import a repo" do + gl_projects.exec + File.exists?(File.join(tmp_repo_path, 'HEAD')).should be_false + end + + it "should log an import-project event" do + message = "Importing project #{repo_name} from <https://github.com/gitlabhq/gitlabhq.git> failed due to timeout." + $logger.should_receive(:error).with(message) + gl_projects.exec + end end end |
