summaryrefslogtreecommitdiff
path: root/spec/features/issues
diff options
context:
space:
mode:
authorJarka Kadlecova <jarka@gitlab.com>2017-07-17 16:38:43 +0200
committerJarka Kadlecova <jarka@gitlab.com>2017-07-19 11:35:17 +0200
commita9d940bffcf7447f8d62012bd1c8f866697a12d6 (patch)
tree98a3cb03c47cb7d066c456e5931ccb5a8662dbb2 /spec/features/issues
parent0cd42fea229a4e3ab9e7e11236b7bd08cff45d00 (diff)
downloadgitlab-ce-a9d940bffcf7447f8d62012bd1c8f866697a12d6.tar.gz
Use Ghost user when edited_by, merged_by deleted34930-fix-edited-by
Diffstat (limited to 'spec/features/issues')
-rw-r--r--spec/features/issues/issue_detail_spec.rb43
1 files changed, 43 insertions, 0 deletions
diff --git a/spec/features/issues/issue_detail_spec.rb b/spec/features/issues/issue_detail_spec.rb
new file mode 100644
index 00000000000..e1c55d246ab
--- /dev/null
+++ b/spec/features/issues/issue_detail_spec.rb
@@ -0,0 +1,43 @@
+require 'rails_helper'
+
+feature 'Issue Detail', js: true, feature: true 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 'issue-title', with: 'issue title'
+ click_button 'Save'
+
+ visit profile_account_path
+ click_link 'Delete account'
+
+ 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