summaryrefslogtreecommitdiff
path: root/spec/features/issues/user_sees_breadcrumb_links_spec.rb
blob: f5793758a9b2e32068abb5f31a61b074f5da875d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe 'New issue breadcrumb' do
  let_it_be(:project, reload: true) { create(:project) }
  let(:user) { project.creator }

  before do
    stub_feature_flags(vue_issuables_list: false)

    sign_in(user)
    visit(new_project_issue_path(project))
  end

  it 'displays link to project issues and new issue' do
    page.within '.breadcrumbs' do
      expect(find_link('Issues')[:href]).to end_with(project_issues_path(project))
      expect(find_link('New')[:href]).to end_with(new_project_issue_path(project))
    end
  end

  it 'links to current issue in breadcrubs' do
    issue = create(:issue, project: project)

    visit project_issue_path(project, issue)

    expect(find('.breadcrumbs-sub-title a')[:href]).to end_with(issue_path(issue))
  end

  it 'excludes award_emoji from comment count' do
    issue = create(:issue, author: user, assignees: [user], project: project, title: 'foobar')
    create(:award_emoji, awardable: issue)

    visit project_issues_path(project, assignee_id: user.id)

    expect(page).to have_content 'foobar'
    expect(page.all('.no-comments').first.text).to eq "0"
  end
end