2019-07-25 01:24:42 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-08-29 03:56:52 -04:00
|
|
|
require 'spec_helper'
|
2018-09-04 12:48:57 -04:00
|
|
|
|
2020-06-16 14:09:01 -04:00
|
|
|
RSpec.describe 'New issue breadcrumb' do
|
2020-01-16 07:08:32 -05:00
|
|
|
let_it_be(:project, reload: true) { create(:project) }
|
2021-06-28 23:07:32 -04:00
|
|
|
|
2018-11-28 14:15:37 -05:00
|
|
|
let(:user) { project.creator }
|
2018-09-04 12:48:57 -04:00
|
|
|
|
|
|
|
before do
|
|
|
|
sign_in(user)
|
2018-11-28 14:15:37 -05:00
|
|
|
visit(new_project_issue_path(project))
|
2018-09-04 12:48:57 -04:00
|
|
|
end
|
|
|
|
|
2018-11-28 14:15:37 -05:00
|
|
|
it 'displays link to project issues and new issue' do
|
2018-09-04 12:48:57 -04:00
|
|
|
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
|
2020-01-16 07:08:32 -05:00
|
|
|
|
|
|
|
it 'links to current issue in breadcrubs' do
|
|
|
|
issue = create(:issue, project: project)
|
|
|
|
|
|
|
|
visit project_issue_path(project, issue)
|
|
|
|
|
2022-05-02 14:10:57 -04:00
|
|
|
expect(find('[data-testid="breadcrumb-current-link"] a')[:href]).to end_with(issue_path(issue))
|
2020-01-16 07:08:32 -05:00
|
|
|
end
|
|
|
|
|
2022-04-27 08:08:19 -04:00
|
|
|
it 'excludes award_emoji from comment count', :js do
|
2020-01-16 07:08:32 -05:00
|
|
|
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
|
2018-09-04 12:48:57 -04:00
|
|
|
end
|