From 79b8323d11cc06911b996f327c6e06fd29cafea4 Mon Sep 17 00:00:00 2001 From: Valery Sizov Date: Fri, 5 May 2017 16:57:27 +0300 Subject: [PATCH] [Multiple issue assignees] Fix issue atom feed --- app/views/issues/_issue.atom.builder | 11 +++++++++-- spec/features/atom/issues_spec.rb | 6 ++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/app/views/issues/_issue.atom.builder b/app/views/issues/_issue.atom.builder index 9ec765c45f9..2ed78bb3b65 100644 --- a/app/views/issues/_issue.atom.builder +++ b/app/views/issues/_issue.atom.builder @@ -26,9 +26,16 @@ xml.entry do if issue.assignees.any? xml.assignees do issue.assignees.each do |assignee| - xml.name assignee.name - xml.email assignee.public_email + xml.assignee do + xml.name assignee.name + xml.email assignee.public_email + end end end + + xml.assignee do + xml.name issue.assignees.first.name + xml.email issue.assignees.first.public_email + end end end diff --git a/spec/features/atom/issues_spec.rb b/spec/features/atom/issues_spec.rb index 78f8f46a04e..4f6754ad541 100644 --- a/spec/features/atom/issues_spec.rb +++ b/spec/features/atom/issues_spec.rb @@ -22,7 +22,8 @@ describe 'Issues Feed', feature: true do to have_content('application/atom+xml') expect(body).to have_selector('title', text: "#{project.name} issues") expect(body).to have_selector('author email', text: issue.author_public_email) - expect(body).to have_selector('assignees email', text: issue.author_public_email) + expect(body).to have_selector('assignees assignee email', text: issue.assignees.first.public_email) + expect(body).to have_selector('assignee email', text: issue.assignees.first.public_email) expect(body).to have_selector('entry summary', text: issue.title) end end @@ -36,7 +37,8 @@ describe 'Issues Feed', feature: true do to have_content('application/atom+xml') expect(body).to have_selector('title', text: "#{project.name} issues") expect(body).to have_selector('author email', text: issue.author_public_email) - expect(body).to have_selector('assignees email', text: issue.author_public_email) + expect(body).to have_selector('assignees assignee email', text: issue.assignees.first.public_email) + expect(body).to have_selector('assignee email', text: issue.assignees.first.public_email) expect(body).to have_selector('entry summary', text: issue.title) end end