diff options
Diffstat (limited to 'spec/lib/gitlab/git/repository_spec.rb')
-rw-r--r-- | spec/lib/gitlab/git/repository_spec.rb | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/spec/lib/gitlab/git/repository_spec.rb b/spec/lib/gitlab/git/repository_spec.rb index 3f11f0a4516..2c0e005e942 100644 --- a/spec/lib/gitlab/git/repository_spec.rb +++ b/spec/lib/gitlab/git/repository_spec.rb @@ -824,6 +824,35 @@ describe Gitlab::Git::Repository, seed_helper: true do it { is_expected.to eq(17) } end + describe '#count_commits' do + context 'with after timestamp' do + options = { ref: 'master', limit: nil, after: Time.iso8601('2013-03-03T20:15:01+00:00') } + it 'returns the number of commits after timestamp' do + commits = repository.log(options) + + expect(repository.count_commits(options)).to eq(commits.size) + end + end + + context 'with before timestamp' do + options = { ref: 'feature', limit: nil, before: Time.iso8601('2015-03-03T20:15:01+00:00') } + it 'returns the number of commits after timestamp' do + commits = repository.log(options) + + expect(repository.count_commits(options)).to eq(commits.size) + end + end + + context 'with path' do + options = { ref: 'master', limit: nil, path: "encoding" } + it 'returns the number of commits with path ' do + commits = repository.log(options) + + expect(repository.count_commits(options)).to eq(commits.size) + end + end + end + describe "branch_names_contains" do subject { repository.branch_names_contains(SeedRepo::LastCommit::ID) } |