2017-07-17 10:38:43 -04:00
|
|
|
require 'rails_helper'
|
|
|
|
|
2017-06-29 00:13:10 -04:00
|
|
|
feature 'Issue Detail', :js do
|
2017-11-06 08:46:27 -05:00
|
|
|
let(:user) { create(:user) }
|
|
|
|
let(:project) { create(:project, :public) }
|
|
|
|
let(:issue) { create(:issue, project: project, author: user) }
|
2017-07-17 10:38:43 -04:00
|
|
|
|
|
|
|
context 'when user displays the issue' do
|
|
|
|
before do
|
|
|
|
visit project_issue_path(project, issue)
|
|
|
|
wait_for_requests
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'shows the issue' do
|
|
|
|
page.within('.issuable-details') do
|
|
|
|
expect(find('h2')).to have_content(issue.title)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'when edited by a user who is later deleted' do
|
|
|
|
before do
|
|
|
|
sign_in(user)
|
|
|
|
visit project_issue_path(project, issue)
|
|
|
|
wait_for_requests
|
|
|
|
|
2017-12-19 12:48:29 -05:00
|
|
|
page.find('.js-issuable-edit').click
|
2017-10-20 15:26:51 -04:00
|
|
|
fill_in 'issuable-title', with: 'issue title'
|
2017-07-17 10:38:43 -04:00
|
|
|
click_button 'Save'
|
2017-11-06 08:46:27 -05:00
|
|
|
wait_for_requests
|
2017-07-17 10:38:43 -04:00
|
|
|
|
2017-10-06 16:40:41 -04:00
|
|
|
Users::DestroyService.new(user).execute(user)
|
2017-07-17 10:38:43 -04:00
|
|
|
|
|
|
|
visit project_issue_path(project, issue)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'shows the issue' do
|
|
|
|
page.within('.issuable-details') do
|
|
|
|
expect(find('h2')).to have_content(issue.reload.title)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|