diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2017-06-28 10:42:59 -0300 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2017-06-28 10:42:59 -0300 |
commit | 26f3731021e8c5c6417fe874c53a5bf2065b8888 (patch) | |
tree | 3b95b3573af0680b8f35a7c6b5ce9f50c2f3b731 /spec/models/project_wiki_spec.rb | |
parent | 2a64607b987add8747c4b9601aa01fe40064d15d (diff) | |
download | gitlab-ce-26f3731021e8c5c6417fe874c53a5bf2065b8888.tar.gz |
Add ProjectWiki#ensure_repositoryport-changes-ee-2467
Diffstat (limited to 'spec/models/project_wiki_spec.rb')
-rw-r--r-- | spec/models/project_wiki_spec.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/models/project_wiki_spec.rb b/spec/models/project_wiki_spec.rb index bf74ac5ea25..1f314791479 100644 --- a/spec/models/project_wiki_spec.rb +++ b/spec/models/project_wiki_spec.rb @@ -278,6 +278,24 @@ describe ProjectWiki, models: true do end end + describe '#ensure_repository' do + it 'creates the repository if it not exist' do + allow(subject).to receive(:repository_exists?).and_return(false) + + expect(subject).to receive(:create_repo!) + + subject.ensure_repository + end + + it 'does not create the repository if it exists' do + allow(subject).to receive(:repository_exists?).and_return(true) + + expect(subject).not_to receive(:create_repo!) + + subject.ensure_repository + end + end + describe '#hook_attrs' do it 'returns a hash with values' do expect(subject.hook_attrs).to be_a Hash |