2014-09-02 18:07:02 +05:30
|
|
|
require 'spec_helper'
|
|
|
|
|
2015-04-26 12:48:37 +05:30
|
|
|
describe 'Issues Feed', feature: true do
|
|
|
|
describe 'GET /issues' do
|
2014-09-02 18:07:02 +05:30
|
|
|
let!(:user) { create(:user) }
|
|
|
|
let!(:project) { create(:project) }
|
|
|
|
let!(:issue) { create(:issue, author: user, project: project) }
|
|
|
|
|
|
|
|
before { project.team << [user, :developer] }
|
|
|
|
|
2015-04-26 12:48:37 +05:30
|
|
|
context 'when authenticated' do
|
2016-09-13 17:45:13 +05:30
|
|
|
it 'renders atom feed' do
|
2014-09-02 18:07:02 +05:30
|
|
|
login_with user
|
2015-04-26 12:48:37 +05:30
|
|
|
visit namespace_project_issues_path(project.namespace, project, :atom)
|
2014-09-02 18:07:02 +05:30
|
|
|
|
2015-04-26 12:48:37 +05:30
|
|
|
expect(response_headers['Content-Type']).
|
|
|
|
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_email)
|
|
|
|
expect(body).to have_selector('entry summary', text: issue.title)
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2015-04-26 12:48:37 +05:30
|
|
|
context 'when authenticated via private token' do
|
2016-09-13 17:45:13 +05:30
|
|
|
it 'renders atom feed' do
|
2015-04-26 12:48:37 +05:30
|
|
|
visit namespace_project_issues_path(project.namespace, project, :atom,
|
|
|
|
private_token: user.private_token)
|
2014-09-02 18:07:02 +05:30
|
|
|
|
2015-04-26 12:48:37 +05:30
|
|
|
expect(response_headers['Content-Type']).
|
|
|
|
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_email)
|
|
|
|
expect(body).to have_selector('entry summary', text: issue.title)
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|