diff options
author | yisiliang <yisiliang@foxmail.com> | 2018-02-07 15:30:30 +0000 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2018-08-21 10:41:47 +0100 |
commit | 0d642e1e3c3619027876034f5af1116d00d96046 (patch) | |
tree | 48454e7ebef188f75cd62ec845eecb94f7f2db11 /spec/models/commit_spec.rb | |
parent | f5e6c44741bc1b4e610cec4eec66d676f6b1ca36 (diff) | |
download | gitlab-ce-0d642e1e3c3619027876034f5af1116d00d96046.tar.gz |
to avoid “NoMethodError (undefined method `split' for nil:NilClass)” while safe_message is nil.
Diffstat (limited to 'spec/models/commit_spec.rb')
-rw-r--r-- | spec/models/commit_spec.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/spec/models/commit_spec.rb b/spec/models/commit_spec.rb index 5157d8fc645..ab241b83077 100644 --- a/spec/models/commit_spec.rb +++ b/spec/models/commit_spec.rb @@ -225,6 +225,11 @@ eos end describe 'description' do + it "returns no_commit_message when safe_message is blank" do + allow(commit).to receive(:safe_message).and_return('') + expect(commit.description).to eq("--no commit message") + end + it 'returns description of commit message if title less than 100 characters' do message = <<eos Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec sodales id felis id blandit. |