debian-mirror-gitlab/spec/features/atom/issues_spec.rb

38 lines
1.4 KiB
Ruby
Raw Normal View History

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
it 'should render 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
it 'should render atom feed' do
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