summaryrefslogtreecommitdiff
path: root/spec/services/files
diff options
context:
space:
mode:
authorNick Thomas <nick@gitlab.com>2018-09-18 10:04:15 +0100
committerNick Thomas <nick@gitlab.com>2018-09-18 12:04:49 +0100
commit5a883915793f0f89f850d5393dce497ff9c5f893 (patch)
tree14a8e12d7554affbd48b29bc2e8efec082cbb128 /spec/services/files
parent12f9879295ac9abdd0d6aff47cc3828c9ca36dc7 (diff)
downloadgitlab-ce-5a883915793f0f89f850d5393dce497ff9c5f893.tar.gz
Guard against regressions in commit email specs
Diffstat (limited to 'spec/services/files')
-rw-r--r--spec/services/files/create_service_spec.rb1
-rw-r--r--spec/services/files/delete_service_spec.rb3
-rw-r--r--spec/services/files/update_service_spec.rb3
3 files changed, 5 insertions, 2 deletions
diff --git a/spec/services/files/create_service_spec.rb b/spec/services/files/create_service_spec.rb
index c8f899e6dff..751b7160276 100644
--- a/spec/services/files/create_service_spec.rb
+++ b/spec/services/files/create_service_spec.rb
@@ -84,6 +84,7 @@ describe Files::CreateService do
it 'uses the commit email' do
subject.execute
+ expect(user.commit_email).not_to eq(user.email)
expect(commit.author_email).to eq(user.commit_email)
expect(commit.committer_email).to eq(user.commit_email)
end
diff --git a/spec/services/files/delete_service_spec.rb b/spec/services/files/delete_service_spec.rb
index ba4a0594666..309802ce733 100644
--- a/spec/services/files/delete_service_spec.rb
+++ b/spec/services/files/delete_service_spec.rb
@@ -4,7 +4,7 @@ describe Files::DeleteService do
subject { described_class.new(project, user, commit_params) }
let(:project) { create(:project, :repository) }
- let(:user) { create(:user) }
+ let(:user) { create(:user, :commit_email) }
let(:file_path) { 'files/ruby/popen.rb' }
let(:branch_name) { project.default_branch }
let(:last_commit_sha) { nil }
@@ -39,6 +39,7 @@ describe Files::DeleteService do
it 'uses the commit email' do
subject.execute
+ expect(user.commit_email).not_to eq(user.email)
expect(commit.author_email).to eq(user.commit_email)
expect(commit.committer_email).to eq(user.commit_email)
end
diff --git a/spec/services/files/update_service_spec.rb b/spec/services/files/update_service_spec.rb
index 3bfa2717960..23db35c2418 100644
--- a/spec/services/files/update_service_spec.rb
+++ b/spec/services/files/update_service_spec.rb
@@ -4,7 +4,7 @@ describe Files::UpdateService do
subject { described_class.new(project, user, commit_params) }
let(:project) { create(:project, :repository) }
- let(:user) { create(:user) }
+ let(:user) { create(:user, :commit_email) }
let(:file_path) { 'files/ruby/popen.rb' }
let(:new_contents) { 'New Content' }
let(:branch_name) { project.default_branch }
@@ -59,6 +59,7 @@ describe Files::UpdateService do
it 'uses the commit email' do
subject.execute
+ expect(user.commit_email).not_to eq(user.email)
expect(commit.author_email).to eq(user.commit_email)
expect(commit.committer_email).to eq(user.commit_email)
end