2019-09-30 12:06:01 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-08-03 11:50:06 +00:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-05-26 21:07:45 +00:00
|
|
|
describe TimeboxesRoutingHelper do
|
2017-08-03 11:50:06 +00:00
|
|
|
let(:project) { build_stubbed(:project) }
|
|
|
|
let(:group) { build_stubbed(:group) }
|
|
|
|
|
|
|
|
describe '#milestone_path' do
|
|
|
|
context 'for a group milestone' do
|
|
|
|
let(:milestone) { build_stubbed(:milestone, group: group, iid: 1) }
|
|
|
|
|
|
|
|
it 'links to the group milestone page' do
|
|
|
|
expect(milestone_path(milestone))
|
|
|
|
.to eq(group_milestone_path(group, milestone))
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'for a project milestone' do
|
|
|
|
let(:milestone) { build_stubbed(:milestone, project: project, iid: 1) }
|
|
|
|
|
|
|
|
it 'links to the project milestone page' do
|
|
|
|
expect(milestone_path(milestone))
|
|
|
|
.to eq(project_milestone_path(project, milestone))
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
describe '#milestone_url' do
|
|
|
|
context 'for a group milestone' do
|
|
|
|
let(:milestone) { build_stubbed(:milestone, group: group, iid: 1) }
|
|
|
|
|
|
|
|
it 'links to the group milestone page' do
|
|
|
|
expect(milestone_url(milestone))
|
|
|
|
.to eq(group_milestone_url(group, milestone))
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'for a project milestone' do
|
|
|
|
let(:milestone) { build_stubbed(:milestone, project: project, iid: 1) }
|
|
|
|
|
|
|
|
it 'links to the project milestone page' do
|
|
|
|
expect(milestone_url(milestone))
|
|
|
|
.to eq(project_milestone_url(project, milestone))
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|