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/features/commits_spec.rb | |
parent | 17ab40ca089e1aef61a83f77ab6df62a72f6ce06 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/features/commits_spec.rb')
-rw-r--r-- | spec/features/commits_spec.rb | 41 |
1 files changed, 39 insertions, 2 deletions
diff --git a/spec/features/commits_spec.rb b/spec/features/commits_spec.rb index f538df89fd3..d8b886b239f 100644 --- a/spec/features/commits_spec.rb +++ b/spec/features/commits_spec.rb @@ -3,8 +3,8 @@ require 'spec_helper' describe 'Commits' do - let(:project) { create(:project, :repository) } - let(:user) { create(:user) } + let_it_be(:project) { create(:project, :repository) } + let_it_be(:user) { create(:user) } describe 'CI' do before do @@ -183,4 +183,41 @@ describe 'Commits' do expect(find('.js-project-refs-dropdown')).to have_content branch_name end end + + context 'viewing commits for an author' do + let(:author_commit) { project.repository.commits(nil, limit: 1).first } + let(:commits) { project.repository.commits(nil, author: author, limit: 40) } + + before do + project.add_maintainer(user) + sign_in(user) + visit project_commits_path(project, nil, author: author) + end + + shared_examples 'show commits by author' do + it "includes the author's commits" do + commits.each do |commit| + expect(page).to have_content("#{author_commit.author_name} authored #{commit.authored_date.strftime("%b %d, %Y")}") + end + end + end + + context 'author is complete' do + let(:author) { "#{author_commit.author_name} <#{author_commit.author_email}>" } + + it_behaves_like 'show commits by author' + end + + context 'author is just a name' do + let(:author) { "#{author_commit.author_name}" } + + it_behaves_like 'show commits by author' + end + + context 'author is just an email' do + let(:author) { "#{author_commit.author_email}" } + + it_behaves_like 'show commits by author' + end + end end |