BigW Consortium Gitlab

Commit 6656faed by Phil Hughes

Tests for not logged in user

parent 03ea267f
...@@ -433,17 +433,40 @@ feature 'Diff notes resolve', feature: true, js: true do ...@@ -433,17 +433,40 @@ feature 'Diff notes resolve', feature: true, js: true do
end end
context 'unauthorized user' do context 'unauthorized user' do
before do context 'no resolved comments' do
visit_merge_request before do
visit_merge_request
end
it 'does not allow user to mark note as resolved' do
page.within '.diff-content .note' do
expect(page).not_to have_selector('.line-resolve-btn')
end
page.within '.line-resolve-all-container' do
expect(page).to have_content('0/1 discussion resolved')
end
end
end end
it 'does not allow user to mark note as resolved' do context 'resolved comment' do
page.within '.diff-content .note' do before do
expect(page).not_to have_selector('.line-resolve-btn') note.resolve!(user)
visit_merge_request
end
it 'shows resolved icon' do
expect(page).to have_content '1/1 discussion resolved'
click_link 'Toggle discussion'
expect(page).to have_selector('.line-resolve-btn.is-active')
end end
page.within '.line-resolve-all-container' do it 'does not allow user to click resolve button' do
expect(page).to have_content('0/1 discussion resolved') expect(page).to have_selector('.line-resolve-btn.is-disabled')
click_link 'Toggle discussion'
expect(page).to have_selector('.line-resolve-btn.is-disabled')
end end
end end
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment