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.rb15
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)