2012-08-03 12:49:54 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2015-02-12 13:53:23 -05:00
|
|
|
describe 'Issues Feed', feature: true do
|
|
|
|
describe 'GET /issues' do
|
2012-11-05 22:31:55 -05:00
|
|
|
let!(:user) { create(:user) }
|
2013-09-05 07:46:34 -04:00
|
|
|
let!(:project) { create(:project) }
|
2012-11-05 22:31:55 -05:00
|
|
|
let!(:issue) { create(:issue, author: user, project: project) }
|
2012-09-12 08:01:50 -04:00
|
|
|
|
2013-01-04 11:50:31 -05:00
|
|
|
before { project.team << [user, :developer] }
|
2012-09-12 08:01:50 -04:00
|
|
|
|
2015-02-12 13:53:23 -05:00
|
|
|
context 'when authenticated' do
|
2016-07-25 14:16:19 -04:00
|
|
|
it 'renders atom feed' do
|
2012-09-12 08:01:50 -04:00
|
|
|
login_with user
|
2015-01-24 13:02:58 -05:00
|
|
|
visit namespace_project_issues_path(project.namespace, project, :atom)
|
2012-09-12 08:01:50 -04:00
|
|
|
|
2015-02-12 13:53:23 -05:00
|
|
|
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)
|
2012-09-12 08:01:50 -04:00
|
|
|
end
|
2012-08-03 12:49:54 -04:00
|
|
|
end
|
|
|
|
|
2015-02-12 13:53:23 -05:00
|
|
|
context 'when authenticated via private token' do
|
2016-07-25 14:16:19 -04:00
|
|
|
it 'renders atom feed' do
|
2015-01-24 13:02:58 -05:00
|
|
|
visit namespace_project_issues_path(project.namespace, project, :atom,
|
|
|
|
private_token: user.private_token)
|
2012-08-03 12:49:54 -04:00
|
|
|
|
2015-02-12 13:53:23 -05:00
|
|
|
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)
|
2012-09-12 08:01:50 -04:00
|
|
|
end
|
2012-08-03 12:49:54 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|