summaryrefslogtreecommitdiff
path: root/spec/models/project_spec.rb
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2018-06-12 13:49:58 +0100
committerFilipa Lacerda <filipa@gitlab.com>2018-06-12 13:49:58 +0100
commit83ad5de637b884d97b3350a468b9a66c71507dca (patch)
tree6344200848b6da6b24a1fdbdb3cc2c4745ee6366 /spec/models/project_spec.rb
parent7f5703484b957718d4f9f576cf8ac22acc45c8de (diff)
parentd94b162129ed7d3131efe7822a4f0c6b4991fb8e (diff)
downloadgitlab-ce-83ad5de637b884d97b3350a468b9a66c71507dca.tar.gz
Merge branch 'master' into fl-eslint-vue-house-keepingfl-eslint-vue-house-keeping
* master: (47 commits) Bumping gitlab-gollum-lib and gitlab-gollum-rugged_adapter i18n: document how to use links without splitting sentences Resolve "[Rails5] `ActionView::MissingTemplate` in spec/features/projects/wiki/user_views_wiki_page_spec.rb" Add CI job to check Gemfile.rails5.lock Add navigation theme documentation Move Gitaly branch/tag/ref RPC's to opt-out Add CI_{PIPELINE,JOB}_URL Resolve "Update docs as GKE cluster creation label has changed from "project ID" to "project"" fixed/enhanced command-line documentation Use nip.io instead of xip.io [Rails5] Update Gitlab.rails5.lock Fix typo in doc/development/README.md Update import screenshot without LFS warning Hide overflow on hr Resolve "Milestone and labels dropdowns are misplaced with collapsed sidebar" Fix collapse sidebar button color Remove .row and .col-sm-12 Relax expectation in spec/models/project_spec.rb fix padding in commit info GitHub Rake importer: Fail with a clearer explanation if GitLab username is wrong ...
Diffstat (limited to 'spec/models/project_spec.rb')
-rw-r--r--spec/models/project_spec.rb14
1 files changed, 12 insertions, 2 deletions
diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb
index b9a9c4ebf42..585cf7aab44 100644
--- a/spec/models/project_spec.rb
+++ b/spec/models/project_spec.rb
@@ -1733,7 +1733,11 @@ describe Project do
.with(project.repository_storage, project.disk_path, project.import_url)
.and_return(true)
- expect_any_instance_of(Repository).to receive(:after_import)
+ # Works around https://github.com/rspec/rspec-mocks/issues/910
+ allow(described_class).to receive(:find).with(project.id).and_return(project)
+ expect(project.repository).to receive(:after_import)
+ .and_call_original
+ expect(project.wiki.repository).to receive(:after_import)
.and_call_original
end
@@ -3398,10 +3402,11 @@ describe Project do
end
describe '#after_import' do
- let(:project) { build(:project) }
+ let(:project) { create(:project) }
it 'runs the correct hooks' do
expect(project.repository).to receive(:after_import)
+ expect(project.wiki.repository).to receive(:after_import)
expect(project).to receive(:import_finish)
expect(project).to receive(:update_project_counter_caches)
expect(project).to receive(:remove_import_jid)
@@ -3658,6 +3663,11 @@ describe Project do
.to be_truthy
end
+ it 'allows access when there are merge requests open but no branch name is given' do
+ expect(project.branch_allows_collaboration?(user, nil))
+ .to be_truthy
+ end
+
it 'does not allow guest users access' do
guest = create(:user)
target_project.add_guest(guest)