2012-08-03 12:49:54 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2014-04-12 04:56:37 -04:00
|
|
|
describe "Issues Feed", feature: true do
|
2012-08-03 12:49:54 -04:00
|
|
|
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
|
|
|
|
|
|
|
context "when authenticated" do
|
|
|
|
it "should render atom feed" do
|
|
|
|
login_with user
|
|
|
|
visit project_issues_path(project, :atom)
|
|
|
|
|
2014-09-24 02:28:41 -04:00
|
|
|
response_headers['Content-Type'].should have_content("application/atom+xml")
|
|
|
|
body.should have_selector("title", text: "#{project.name} issues")
|
|
|
|
body.should have_selector("author email", text: issue.author_email)
|
|
|
|
body.should 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
|
|
|
|
|
2012-09-12 08:01:50 -04:00
|
|
|
context "when authenticated via private token" do
|
|
|
|
it "should render atom feed" do
|
|
|
|
visit project_issues_path(project, :atom, private_token: user.private_token)
|
2012-08-03 12:49:54 -04:00
|
|
|
|
2014-09-24 02:28:41 -04:00
|
|
|
response_headers['Content-Type'].should have_content("application/atom+xml")
|
|
|
|
body.should have_selector("title", text: "#{project.name} issues")
|
|
|
|
body.should have_selector("author email", text: issue.author_email)
|
|
|
|
body.should 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
|