BigW Consortium Gitlab

issues_spec.rb 1.29 KB
Newer Older
1 2
require 'spec_helper'

3
describe "Issues Feed", feature: true  do
4
  describe "GET /issues" do
5
    let!(:user)     { create(:user) }
6
    let!(:project)  { create(:project) }
7
    let!(:issue)    { create(:issue, author: user, project: project) }
8

Dmitriy Zaporozhets committed
9
    before { project.team << [user, :developer] }
10 11 12 13 14 15 16 17 18 19 20

    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
21 22
    end

23 24 25
    context "when authenticated via private token" do
      it "should render atom feed" do
        visit project_issues_path(project, :atom, private_token: user.private_token)
26

27 28 29 30 31
        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
32 33 34
    end
  end
end