it'should not allow commenting on the right side'do
context'with an old line on the left and no line on the right'do
let(:line_holder){first:xpath,'//*[contains(concat(" ", @class, " "), " line_holder ") and child::*[contains(concat(" ", @class, " "), " line_content ") and contains(concat(" ", @class, " "), " old ")] and child::*[contains(concat(" ", @class, " ")," line_content ") and not(contains(concat(" ", @class, " ")," old ")) and not(contains(concat(" ", @class, " ")," new ")) and not(contains(concat(" ", @class, " ")," match ")) and not(boolean(node()[1]))]]'}
end
end
context'with no line on the left and a new line on the right'do
it'should allow commenting on the left side'do
it'should allow commenting on the right side'do
should_allow_commentingline_holder,'left'
end
it'should not allow commenting on the right side'do
should_not_allow_commentingline_holder,'right'
end
end
end
it'should not allow commenting on the left side'do
context'with no line on the left and a new line on the right'do
let(:line_holder){first:xpath,'//*[contains(concat(" ", @class, " "), " line_holder ") and child::*[contains(concat(" ", @class, " ")," line_content ") and not(contains(concat(" ", @class, " ")," old ")) and not(contains(concat(" ", @class, " ")," new ")) and not(contains(concat(" ", @class, " ")," match ")) and not(boolean(node()[1]))] and child::*[contains(concat(" ", @class, " ")," line_content ") and contains(concat(" ", @class, " ")," new ")]]'}
end
it'should not allow commenting on the left side'do
end
should_not_allow_commentingline_holder,'left'
end
context'with an old line on the left and a new line on the right'do
it'should allow commenting on the left side'do
it'should allow commenting on the right side'do
should_allow_commentingline_holder,'right'
end
end
end
it'should allow commenting on the right side'do
context'with an old line on the left and a new line on the right'do
let(:line_holder){first:xpath,'//*[contains(concat(" ", @class, " "), " line_holder ") and child::*[contains(concat(" ", @class, " "), " line_content ") and contains(concat(" ", @class, " "), " old ")] and child::*[contains(concat(" ", @class, " ")," line_content ") and contains(concat(" ", @class, " ")," new ")]]'}
it'should allow commenting on the left side'do
should_allow_commentingline_holder,'left'
end
it'should allow commenting on the right side'do
should_allow_commentingline_holder,'right'
end
end
end
end
context'with an unchanged line on the left and an unchanged line on the right'do
context'with an unchanged line on the left and an unchanged line on the right'do
it'should allow commenting on the left side'do
let(:line_holder){first:xpath,'//*[contains(concat(" ", @class, " "), " line_holder ") and child::*[contains(concat(" ", @class, " ")," line_content ") and not(contains(concat(" ", @class, " ")," old ")) and not(contains(concat(" ", @class, " ")," new ")) and not(contains(concat(" ", @class, " ")," match ")) and boolean(node()[1])] and child::*[contains(concat(" ", @class, " ")," line_content ") and not(contains(concat(" ", @class, " ")," old ")) and not(contains(concat(" ", @class, " ")," new ")) and not(contains(concat(" ", @class, " ")," match ")) and boolean(node()[1])]]'}
it'should allow commenting on the left side'do
should_allow_commentingline_holder,'left'
end
it'should allow commenting on the right side'do
should_allow_commentingline_holder,'right'
end
end
end
it'should allow commenting on the right side'do
context'with a match line'do
let(:line_holder){first:xpath,'//*[contains(concat(" ", @class, " "), " line_holder ") and child::*[contains(concat(" ", @class, " "), " line_content ") and contains(concat(" ", @class, " "), " match ")] and child::*[contains(concat(" ", @class, " ")," line_content ") and contains(concat(" ", @class, " ")," match ")]]'}
it'should not allow commenting on the left side'do
should_not_allow_commentingline_holder,'left'
end
it'should not allow commenting on the right side'do
should_not_allow_commentingline_holder,'right'
end
end
end
end
end
context'with a match line'do
context'when hovering over the inline view diff file'do
it'should not allow commenting on the left side'do
# @old_line_number = first '.diff-line-num.old_line:not(.unfold)'
end
# @new_line_number = first '.diff-line-num.new_line:not(.unfold)'
# @new_line = first '.line_content:not(.match)'
end
context'with a new line'do
context'with an unchanged line'do
it'should allow commenting'do
let(:line_holder){first:xpath,'//*[contains(concat(" ", @class, " "), " line_holder ") and child::*[contains(concat(" ", @class, " ")," line_content ") and not(contains(concat(" ", @class, " ")," old ")) and not(contains(concat(" ", @class, " ")," new ")) and not(contains(concat(" ", @class, " ")," match ")) and boolean(node()[1])] and child::*[contains(concat(" ", @class, " ")," line_content ") and not(contains(concat(" ", @class, " ")," old ")) and not(contains(concat(" ", @class, " ")," new ")) and not(contains(concat(" ", @class, " ")," match ")) and boolean(node()[1])]]'}
it'should allow commenting'do
should_allow_commentingline_holder
end
end
end
end
context'with an old line'do
context'with a match line'do
it'should allow commenting'do
let(:line_holder){first:xpath,'//*[contains(concat(" ", @class, " "), " line_holder ") and child::*[contains(concat(" ", @class, " "), " line_content ") and contains(concat(" ", @class, " "), " match ")]]'}