it'should not allow commenting on the right side'do
end
end
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]))]]'}
context'with no line on the left and a new line on the right'do
it'should allow commenting on the right side'do
it'should allow commenting on the left 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
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
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 not allow commenting on the left side'do
should_not_allow_commentingline_holder,'left'
end
it'should allow commenting on the right side'do
should_allow_commentingline_holder,'right'
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
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
context'with an unchanged line on the left and an unchanged 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 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
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
context'with a match line'do
it'should not allow commenting on the left side'do
context'when hovering over the inline view diff file'do
# @old_line_number = first '.diff-line-num.old_line:not(.unfold)'
# @new_line_number = first '.diff-line-num.new_line:not(.unfold)'
# @new_line = first '.line_content:not(.match)'
end
it'should allow commenting'do
should_allow_commentingline_holder
end
end
context'with a new line'do
it'should allow commenting'do
context'with an unchanged line'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
context'with an old line'do
it'should allow commenting'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 ")]]'}