diff options
author | Oswaldo Ferreira <oswaldo@gitlab.com> | 2017-03-02 23:06:06 -0300 |
---|---|---|
committer | Oswaldo Ferreira <oswaldo@gitlab.com> | 2017-03-07 22:56:31 -0300 |
commit | d13451cd49e3380c3b69c3143cea929a9b3ec06a (patch) | |
tree | f5dbe7d0775bcbb47811e1323d7a5c1d026297b6 /spec/lib | |
parent | c46f933bb7cb6eccdf648112a57872dc24ebf3ad (diff) | |
download | gitlab-ce-d13451cd49e3380c3b69c3143cea929a9b3ec06a.tar.gz |
Returns correct header data for commits endpoint
Diffstat (limited to 'spec/lib')
-rw-r--r-- | spec/lib/gitlab/git/repository_spec.rb | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/spec/lib/gitlab/git/repository_spec.rb b/spec/lib/gitlab/git/repository_spec.rb index 2c0e005e942..bc139d5ef28 100644 --- a/spec/lib/gitlab/git/repository_spec.rb +++ b/spec/lib/gitlab/git/repository_spec.rb @@ -826,29 +826,26 @@ describe Gitlab::Git::Repository, seed_helper: true do 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) + options = { ref: 'master', limit: nil, after: Time.iso8601('2013-03-03T20:15:01+00:00') } - expect(repository.count_commits(options)).to eq(commits.size) + expect(repository.count_commits(options)).to eq(25) 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) + options = { ref: 'feature', limit: nil, before: Time.iso8601('2015-03-03T20:15:01+00:00') } - expect(repository.count_commits(options)).to eq(commits.size) + expect(repository.count_commits(options)).to eq(9) 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) + options = { ref: 'master', limit: nil, path: "encoding" } - expect(repository.count_commits(options)).to eq(commits.size) + expect(repository.count_commits(options)).to eq(2) end end end |