2012-08-03 18:49:54 +02:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2012-09-12 14:01:50 +02:00
|
|
|
describe "Issues Feed" do
|
2012-08-03 18:49:54 +02:00
|
|
|
describe "GET /issues" do
|
2012-11-06 04:31:55 +01:00
|
|
|
let!(:user) { create(:user) }
|
|
|
|
let!(:project) { create(:project, owner: user) }
|
|
|
|
let!(:issue) { create(:issue, author: user, project: project) }
|
2012-09-12 14:01:50 +02:00
|
|
|
|
|
|
|
before { project.add_access(user, :read, :write) }
|
|
|
|
|
|
|
|
context "when authenticated" do
|
|
|
|
it "should render atom feed" do
|
|
|
|
login_with user
|
|
|
|
visit project_issues_path(project, :atom)
|
|
|
|
|
|
|
|
page.response_headers['Content-Type'].should have_content("application/atom+xml")
|
|
|
|
page.body.should have_selector("title", text: "#{project.name} issues")
|
|
|
|
page.body.should have_selector("author email", text: issue.author_email)
|
|
|
|
page.body.should have_selector("entry summary", text: issue.title)
|
|
|
|
end
|
2012-08-03 18:49:54 +02:00
|
|
|
end
|
|
|
|
|
2012-09-12 14:01:50 +02: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 18:49:54 +02:00
|
|
|
|
2012-09-12 14:01:50 +02:00
|
|
|
page.response_headers['Content-Type'].should have_content("application/atom+xml")
|
|
|
|
page.body.should have_selector("title", text: "#{project.name} issues")
|
|
|
|
page.body.should have_selector("author email", text: issue.author_email)
|
|
|
|
page.body.should have_selector("entry summary", text: issue.title)
|
|
|
|
end
|
2012-08-03 18:49:54 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|