diff options
author | Phil Hughes <me@iamphill.com> | 2019-02-08 22:43:34 +0300 |
---|---|---|
committer | GitLab Release Tools Bot <robert+release-tools@gitlab.com> | 2019-02-11 17:02:41 +0300 |
commit | eed03143b1256d05d5a70e4de61c4ff8db89d77f (patch) | |
tree | 8854442f7e2f17f7d995fb76d5f1e3a7c090901d /spec | |
parent | 150c1cb0044971781654a81e10a570e7c8a98b63 (diff) |
Merge branch '57428-actionview-template-error-undefined-method-for-nil-nilclass' into 'master'
Resolve "ActionView::Template::Error: undefined method `>' for nil:NilClass"
Closes #57428
See merge request gitlab-org/gitlab-ce!25028
(cherry picked from commit 5b23f2b016f4e5d33387d7474148d2a59b213ee6)
b177d523 Checking MR status date for related MR status tooltip
81b875f0 Added tests for merge_request_status partial
20ce370f Improved readability of issues related MR status spec
Diffstat (limited to 'spec')
-rw-r--r-- | spec/views/projects/issues/_merge_requests_status.html.haml_spec.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/views/projects/issues/_merge_requests_status.html.haml_spec.rb b/spec/views/projects/issues/_merge_requests_status.html.haml_spec.rb new file mode 100644 index 00000000000..02c225292ce --- /dev/null +++ b/spec/views/projects/issues/_merge_requests_status.html.haml_spec.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true +require 'spec_helper' + +describe 'projects/issues/_merge_requests_status.html.haml' do + it 'shows date of status change in tooltip' do + merge_request = create(:merge_request, created_at: 1.month.ago) + + render partial: 'projects/issues/merge_requests_status', + locals: { merge_request: merge_request, css_class: '' } + + expect(rendered).to match("Opened.*about 1 month ago") + end + + it 'shows only status in tooltip if date is not set' do + merge_request = create(:merge_request, state: :closed) + + render partial: 'projects/issues/merge_requests_status', + locals: { merge_request: merge_request, css_class: '' } + + expect(rendered).to match("Closed") + end +end |