summaryrefslogtreecommitdiff
path: root/.rspec
diff options
context:
space:
mode:
authorhhoopes <heidih@gmail.com>2016-08-25 10:38:07 -0600
committerSean McGivern <sean@gitlab.com>2016-11-25 15:23:49 +0000
commitf928dba99b0550cefa7534d7fd5bd1ea16609274 (patch)
tree59414f92b38a10f154dd2035053d2b7f56461046 /.rspec
parent24070bac45134c915c13d3e94723a44f59ab4e3a (diff)
downloadgitlab-ce-f928dba99b0550cefa7534d7fd5bd1ea16609274.tar.gz
Change diff highlight/truncate for reusability
Previously the `truncated_diff_lines` method for outputting a discussion diff took in already highlighted lines, which meant it wasn't reuseable for truncating ANY lines. In the way it was used, it also meant that for any email truncation, the whole diff was being highlighted before being truncated, meaning wasted time highlighting lines that wouldn't even be used (granted, they were being memoized, so perhaps this wasn't that great of an issue). I refactored truncation away from highlighting, in order to truncate formatted diffs for text templates in email, using `>`s to designate each line, but otherwise retaining the parsing already done to create `diff_lines`. Additionally, while notes on merge requests or commits had already been tested, there was no existing test for notes on a diff on an MR or commit. Added mailer tests for such, and a unit test for truncating diff lines.
Diffstat (limited to '.rspec')
0 files changed, 0 insertions, 0 deletions