2020-07-23 09:09:18 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
RSpec.describe Projects::IncidentsHelper do
|
|
|
|
include Gitlab::Routing.url_helpers
|
|
|
|
|
|
|
|
let(:project) { create(:project) }
|
|
|
|
let(:project_path) { project.full_path }
|
2020-07-25 00:09:23 +00:00
|
|
|
let(:new_issue_path) { new_project_issue_path(project) }
|
2020-07-27 15:09:25 +00:00
|
|
|
let(:issue_path) { project_issues_path(project) }
|
2020-09-21 12:09:34 +00:00
|
|
|
let(:params) do
|
|
|
|
{
|
|
|
|
search: 'search text',
|
|
|
|
author_username: 'root',
|
|
|
|
assignee_username: 'max.power'
|
|
|
|
}
|
|
|
|
end
|
2020-07-23 09:09:18 +00:00
|
|
|
|
|
|
|
describe '#incidents_data' do
|
2020-09-21 12:09:34 +00:00
|
|
|
subject(:data) { helper.incidents_data(project, params) }
|
2020-07-23 09:09:18 +00:00
|
|
|
|
|
|
|
it 'returns frontend configuration' do
|
2020-10-15 12:09:06 +00:00
|
|
|
expect(data).to include(
|
2020-07-25 00:09:23 +00:00
|
|
|
'project-path' => project_path,
|
|
|
|
'new-issue-path' => new_issue_path,
|
2020-07-27 15:09:25 +00:00
|
|
|
'incident-template-name' => 'incident',
|
2020-08-17 12:10:12 +00:00
|
|
|
'incident-type' => 'incident',
|
2020-08-19 12:10:17 +00:00
|
|
|
'issue-path' => issue_path,
|
2020-09-21 12:09:34 +00:00
|
|
|
'empty-list-svg-path' => match_asset_path('/assets/illustrations/incident-empty-state.svg'),
|
|
|
|
'text-query': 'search text',
|
2020-10-15 18:08:43 +00:00
|
|
|
'author-username-query': 'root',
|
|
|
|
'assignee-username-query': 'max.power'
|
2020-07-25 00:09:23 +00:00
|
|
|
)
|
2020-07-23 09:09:18 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|