@@ -29,7 +29,7 @@ class MigrateProjectFeatures < ActiveRecord::Migration
end
defdown
sql=%Q{
sql=%{
UPDATE projects
SET
issues_enabled = COALESCE((SELECT CASE WHEN issues_access_level = 20 THEN true ELSE false END AS issues_enabled FROM project_features WHERE project_features.project_id = projects.id), true),
code=%Q{-<span id="LC9" class="line"> <span class="k">raise</span> <span class="s2">"System commands must be given as an array of strings"</span></span>\n}
code=%{-<span id="LC9" class="line"> <span class="k">raise</span> <span class="s2">"System commands must be given as an array of strings"</span></span>\n}
expect(subject[4].text).toeq(code)
end
it'highlights and marks added lines'do
code=%Q{+<span id="LC9" class="line"> <span class="k">raise</span> <span class="no"><span class='idiff left'>RuntimeError</span></span><span class="p"><span class='idiff'>,</span></span><span class='idiff right'> </span><span class="s2">"System commands must be given as an array of strings"</span></span>\n}
code=%{+<span id="LC9" class="line"> <span class="k">raise</span> <span class="no"><span class='idiff left'>RuntimeError</span></span><span class="p"><span class='idiff'>,</span></span><span class='idiff right'> </span><span class="s2">"System commands must be given as an array of strings"</span></span>\n}
expect(subject[5].text).toeq(code)
end
...
...
@@ -53,21 +53,21 @@ describe Gitlab::Diff::Highlight, lib: true do
end
it'marks unchanged lines'do
code=%Q{ def popen(cmd, path=nil)}
code=%{ def popen(cmd, path=nil)}
expect(subject[2].text).toeq(code)
expect(subject[2].text).not_tobe_html_safe
end
it'marks removed lines'do
code=%Q{- raise "System commands must be given as an array of strings"}
code=%{- raise "System commands must be given as an array of strings"}
expect(subject[4].text).toeq(code)
expect(subject[4].text).not_tobe_html_safe
end
it'marks added lines'do
code=%Q{+ raise <span class='idiff left right'>RuntimeError, </span>"System commands must be given as an array of strings"}
code=%{+ raise <span class='idiff left right'>RuntimeError, </span>"System commands must be given as an array of strings"}