gitlab-org--gitlab-foss/spec/features/issues/issue_detail_spec.rb
Yorick Peterse d825c9cb5d
Clean up schema of the "issues" table
This adds various foreign key constraints, indexes, missing NOT NULL
constraints, and changes some column types from timestamp to
timestamptz.

Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/31811
2017-11-09 18:00:30 +01:00

43 lines
1 KiB
Ruby

require 'rails_helper'
feature 'Issue Detail', :js do
let(:user) { create(:user) }
let(:project) { create(:project, :public) }
let(:issue) { create(:issue, project: project, author: user) }
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
click_link 'Edit'
fill_in 'issuable-title', with: 'issue title'
click_button 'Save'
wait_for_requests
Users::DestroyService.new(user).execute(user)
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