<commit_before>require 'spec_helper'

describe "User Issues Dashboard" do
  describe "GET /issues" do
    before do

      login_as :user

      @project1 = Factory :project,
        :path => "project1",
        :code => "TEST1"

      @project2 = Factory :project,
        :path => "project2",
        :code => "TEST2"

      @project1.add_access(@user, :read, :write)
      @project2.add_access(@user, :read, :write)

      @issue1 = Factory :issue,
        :author => @user,
        :assignee => @user,
        :project => @project1

      @issue2 = Factory :issue,
        :author => @user,
        :assignee => @user,
        :project => @project2

      visit issues_path
    end

    subject { page }

    it { should have_content(@issue1.title) }
    it { should have_content(@issue1.project.name) }
    it { should have_content(@issue1.assignee.name) }

    it { should have_content(@issue2.title) }
    it { should have_content(@issue2.project.name) }
    it { should have_content(@issue2.assignee.name) }

    it "should render atom feed via private token" do
      logout
      visit issues_path(:atom, :private_token => @user.private_token)

      page.response_headers['Content-Type'].should have_content("application/atom+xml")
      page.body.should have_selector("title", :text => "#{@user.name} issues")
      page.body.should have_selector("author email", :text => @issue1.author_email)
      page.body.should have_selector("entry summary", :text => @issue1.title)
    end
  end
end<commit_msg>Check that issues from different projects get into the atom feed<commit_after>require 'spec_helper'

describe "User Issues Dashboard" do
  describe "GET /issues" do
    before do

      login_as :user

      @project1 = Factory :project,
        :path => "project1",
        :code => "TEST1"

      @project2 = Factory :project,
        :path => "project2",
        :code => "TEST2"

      @project1.add_access(@user, :read, :write)
      @project2.add_access(@user, :read, :write)

      @issue1 = Factory :issue,
        :author => @user,
        :assignee => @user,
        :project => @project1

      @issue2 = Factory :issue,
        :author => @user,
        :assignee => @user,
        :project => @project2

      visit issues_path
    end

    subject { page }

    it { should have_content(@issue1.title) }
    it { should have_content(@issue1.project.name) }
    it { should have_content(@issue1.assignee.name) }

    it { should have_content(@issue2.title) }
    it { should have_content(@issue2.project.name) }
    it { should have_content(@issue2.assignee.name) }

    it "should render atom feed via private token" do
      logout
      visit issues_path(:atom, :private_token => @user.private_token)

      page.response_headers['Content-Type'].should have_content("application/atom+xml")
      page.body.should have_selector("title", :text => "#{@user.name} issues")
      page.body.should have_selector("author email", :text => @issue1.author_email)
      page.body.should have_selector("entry summary", :text => @issue1.title)
      page.body.should have_selector("author email", :text => @issue2.author_email)
      page.body.should have_selector("entry summary", :text => @issue2.title)
    end
  end
end
{'fraction_non_alphanumeric': 0.1321395492435937, 'fraction_numerical': 0.012966965112689102, 'mean_word_length': 2.917775090689238, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3810423', 'n_tokens_mistral': 1021, 'n_tokens_neox': 984, 'n_words': 239}