rss_spec.rb 816 Bytes
Newer Older
1 2
# frozen_string_literal: true

3 4
require 'spec_helper'

5
describe 'Project Issues RSS' do
6
  let(:project) { create(:project, visibility_level: Gitlab::VisibilityLevel::PUBLIC) }
7
  let(:path) { project_issues_path(project) }
8 9 10 11 12 13

  before do
    create(:issue, project: project)
  end

  context 'when signed in' do
14 15
    let(:user) { create(:user) }

16
    before do
17
      project.add_developer(user)
18
      sign_in(user)
19 20 21
      visit path
    end

22 23
    it_behaves_like "it has an RSS button with current_user's feed token"
    it_behaves_like "an autodiscoverable RSS feed with current_user's feed token"
24 25 26 27 28 29 30
  end

  context 'when signed out' do
    before do
      visit path
    end

31 32
    it_behaves_like "it has an RSS button without a feed token"
    it_behaves_like "an autodiscoverable RSS feed without a feed token"
33 34
  end
end