2020-07-23 05:09:18 -04: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-24 20:09:23 -04:00
|
|
|
let(:new_issue_path) { new_project_issue_path(project) }
|
2020-07-27 11:09:25 -04:00
|
|
|
let(:issue_path) { project_issues_path(project) }
|
2020-07-23 05:09:18 -04:00
|
|
|
|
|
|
|
describe '#incidents_data' do
|
|
|
|
subject(:data) { helper.incidents_data(project) }
|
|
|
|
|
|
|
|
it 'returns frontend configuration' do
|
2020-07-24 20:09:23 -04:00
|
|
|
expect(data).to match(
|
|
|
|
'project-path' => project_path,
|
|
|
|
'new-issue-path' => new_issue_path,
|
2020-07-27 11:09:25 -04:00
|
|
|
'incident-template-name' => 'incident',
|
2020-08-17 08:10:12 -04:00
|
|
|
'incident-type' => 'incident',
|
2020-07-27 11:09:25 -04:00
|
|
|
'issue-path' => issue_path
|
2020-07-24 20:09:23 -04:00
|
|
|
)
|
2020-07-23 05:09:18 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|