summaryrefslogtreecommitdiff
path: root/spec/models/repository_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/models/repository_spec.rb')
-rw-r--r--spec/models/repository_spec.rb16
1 files changed, 14 insertions, 2 deletions
diff --git a/spec/models/repository_spec.rb b/spec/models/repository_spec.rb
index 419e1dc2459..b6de5e175dc 100644
--- a/spec/models/repository_spec.rb
+++ b/spec/models/repository_spec.rb
@@ -1075,7 +1075,7 @@ describe Repository do
let(:ref) { 'refs/heads/master' }
it 'returns nil' do
- is_expected.to eq(nil)
+ is_expected.to be_nil
end
end
@@ -1972,7 +1972,7 @@ describe Repository do
it 'returns nil if repo does not exist' do
allow(repository).to receive(:root_ref).and_raise(Gitlab::Git::Repository::NoRepository)
- expect(repository.avatar).to eq(nil)
+ expect(repository.avatar).to be_nil
end
it 'returns the first avatar file found in the repository' do
@@ -2623,6 +2623,10 @@ describe Repository do
expect { repository.create_if_not_exists }.to change { repository.exists? }.from(false).to(true)
end
+ it 'returns true' do
+ expect(repository.create_if_not_exists).to eq(true)
+ end
+
it 'calls out to the repository client to create a repo' do
expect(repository.raw.gitaly_repository_client).to receive(:create_repository)
@@ -2637,6 +2641,10 @@ describe Repository do
repository.create_if_not_exists
end
+
+ it 'returns nil' do
+ expect(repository.create_if_not_exists).to be_nil
+ end
end
context 'when the repository exists but the cache is not up to date' do
@@ -2648,6 +2656,10 @@ describe Repository do
expect { repository.create_if_not_exists }.not_to raise_error
end
+
+ it 'returns nil' do
+ expect(repository.create_if_not_exists).to be_nil
+ end
end
end