diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-26 21:09:24 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-26 21:09:24 +0300 |
commit | 619d0b6922a6cf95d291fbbf5fa3d09e772a1ea8 (patch) | |
tree | fb8f8e036cec1b32166206bb5102af6c5dca8cfe /spec/models | |
parent | 17ab40ca089e1aef61a83f77ab6df62a72f6ce06 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/repository_spec.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/models/repository_spec.rb b/spec/models/repository_spec.rb index 00ffc3cae54..076897e6312 100644 --- a/spec/models/repository_spec.rb +++ b/spec/models/repository_spec.rb @@ -320,6 +320,21 @@ describe Repository do end end + context "when 'author' is set" do + it "returns commits from that author" do + commit = repository.commits(nil, limit: 1).first + known_author = "#{commit.author_name} <#{commit.author_email}>" + + expect(repository.commits(nil, author: known_author, limit: 1)).not_to be_empty + end + + it "doesn't returns commits from an unknown author" do + unknown_author = "The Man With No Name <zapp@brannigan.com>" + + expect(repository.commits(nil, author: unknown_author, limit: 1)).to be_empty + end + end + context "when 'all' flag is set" do it 'returns every commit from the repository' do expect(repository.commits(nil, all: true, limit: 60).size).to eq(60) |