diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-22 11:31:16 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-22 11:31:16 +0000 |
commit | 905c1110b08f93a19661cf42a276c7ea90d0a0ff (patch) | |
tree | 756d138db422392c00471ab06acdff92c5a9b69c /spec/lib/gitlab/email/message/repository_push_spec.rb | |
parent | 50d93f8d1686950fc58dda4823c4835fd0d8c14b (diff) | |
download | gitlab-ce-905c1110b08f93a19661cf42a276c7ea90d0a0ff.tar.gz |
Add latest changes from gitlab-org/gitlab@12-4-stable-ee
Diffstat (limited to 'spec/lib/gitlab/email/message/repository_push_spec.rb')
-rw-r--r-- | spec/lib/gitlab/email/message/repository_push_spec.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/lib/gitlab/email/message/repository_push_spec.rb b/spec/lib/gitlab/email/message/repository_push_spec.rb index 84c5b38127e..b57764bceef 100644 --- a/spec/lib/gitlab/email/message/repository_push_spec.rb +++ b/spec/lib/gitlab/email/message/repository_push_spec.rb @@ -28,90 +28,107 @@ describe Gitlab::Email::Message::RepositoryPush do describe '#project' do subject { message.project } + it { is_expected.to eq project } it { is_expected.to be_an_instance_of Project } end describe '#project_namespace' do subject { message.project_namespace } + it { is_expected.to eq group } it { is_expected.to be_kind_of Namespace } end describe '#project_name_with_namespace' do subject { message.project_name_with_namespace } + it { is_expected.to eq "#{group.name} / #{project.path}" } end describe '#author' do subject { message.author } + it { is_expected.to eq author } it { is_expected.to be_an_instance_of User } end describe '#author_name' do subject { message.author_name } + it { is_expected.to eq 'Author' } end describe '#commits' do subject { message.commits } + it { is_expected.to be_kind_of Array } it { is_expected.to all(be_instance_of Commit) } end describe '#diffs' do subject { message.diffs } + it { is_expected.to all(be_an_instance_of Gitlab::Diff::File) } end describe '#diffs_count' do subject { message.diffs_count } + it { is_expected.to eq raw_compare.diffs.size } end describe '#compare' do subject { message.compare } + it { is_expected.to be_an_instance_of Compare } end describe '#compare_timeout' do subject { message.compare_timeout } + it { is_expected.to eq raw_compare.diffs.overflow? } end describe '#reverse_compare?' do subject { message.reverse_compare? } + it { is_expected.to eq false } end describe '#disable_diffs?' do subject { message.disable_diffs? } + it { is_expected.to eq false } end describe '#send_from_committer_email?' do subject { message.send_from_committer_email? } + it { is_expected.to eq true } end describe '#action_name' do subject { message.action_name } + it { is_expected.to eq 'pushed to' } end describe '#ref_name' do subject { message.ref_name } + it { is_expected.to eq 'master' } end describe '#ref_type' do subject { message.ref_type } + it { is_expected.to eq 'branch' } end describe '#target_url' do subject { message.target_url } + it { is_expected.to include 'compare' } it { is_expected.to include compare.commits.first.parents.first.id } it { is_expected.to include compare.commits.last.id } @@ -119,6 +136,7 @@ describe Gitlab::Email::Message::RepositoryPush do describe '#subject' do subject { message.subject } + it { is_expected.to include "[Git][#{project.full_path}]" } it { is_expected.to include "#{compare.commits.length} commits" } it { is_expected.to include compare.commits.first.message.split("\n").first } |