diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2016-07-27 13:11:50 +0300 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2016-07-27 13:11:50 +0300 |
commit | a1f08a76b5292795ae32a1ccb3cfc919a894daaf (patch) | |
tree | 2e18ab6560fa8108620cb3abac6460fda46b8971 /spec/models/project_spec.rb | |
parent | d2b026f09288fd1abd3ad5dcf27816189c69c729 (diff) | |
parent | f4804d5bb4b37f4de80e4a2e248f0958c615b618 (diff) |
Merge remote-tracking branch 'upstream/master' into new-issue-by-email
* upstream/master: (38 commits)
Remove useless new route
Update gitlab-shell version to 3.2.1 in the 8.9->8.10 update guide
Fix typo in Elixir CI template
Add a spec for access_for_user_ids
Fix typo in comment
Rubocop offenses
Optimize the invited group link access level check
Incorporate review comments
Optimize maximum user access level lookup in loading of notes
Fix missing schema update for 20160722221922
Whitelist 'Simplified BSD' license
Fix a bug where forking a project from a repository storage to another would fail
Remove inline scripts from import pages.
Make branches sortable without push permission (!5462)
Profile requests when a header is passed
Upgrade database_cleaner from 1.4.1 to 1.5.3.
Show release notes in tag list
Fix expand all diffs button in compare view
Add route for Import::GithubController#new
Update CHANGELOG
...
Diffstat (limited to 'spec/models/project_spec.rb')
-rw-r--r-- | spec/models/project_spec.rb | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index 07e3be6f6e6..6e5f50f488f 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -1272,6 +1272,32 @@ describe Project, models: true do end end + describe '#add_import_job' do + context 'forked' do + let(:forked_project_link) { create(:forked_project_link) } + let(:forked_from_project) { forked_project_link.forked_from_project } + let(:project) { forked_project_link.forked_to_project } + + it 'schedules a RepositoryForkWorker job' do + expect(RepositoryForkWorker).to receive(:perform_async). + with(project.id, forked_from_project.repository_storage_path, + forked_from_project.path_with_namespace, project.namespace.path) + + project.add_import_job + end + end + + context 'not forked' do + let(:project) { create(:project) } + + it 'schedules a RepositoryImportWorker job' do + expect(RepositoryImportWorker).to receive(:perform_async).with(project.id) + + project.add_import_job + end + end + end + describe '.where_paths_in' do context 'without any paths' do it 'returns an empty relation' do |