diff options
author | Stan Hu <stanhu@gmail.com> | 2017-08-02 16:58:28 -0700 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2017-08-02 16:58:28 -0700 |
commit | 408df2edcbd5f3f93ef5541bac9de2b71ba4f0ea (patch) | |
tree | 708ae61f9683b48f436f7577d1fad98f30e100fc /spec/helpers/gitlab_routing_helper_spec.rb | |
parent | 3f81586ef0ab20533b8da1213bd9f60e1786dbaa (diff) | |
parent | faa2a123911eaf84bb57163ea7af759d4632601b (diff) | |
download | gitlab-ce-408df2edcbd5f3f93ef5541bac9de2b71ba4f0ea.tar.gz |
Merge branch 'master' into sh-headless-chrome-support
Diffstat (limited to 'spec/helpers/gitlab_routing_helper_spec.rb')
-rw-r--r-- | spec/helpers/gitlab_routing_helper_spec.rb | 69 |
1 files changed, 48 insertions, 21 deletions
diff --git a/spec/helpers/gitlab_routing_helper_spec.rb b/spec/helpers/gitlab_routing_helper_spec.rb index 14847d0a49e..9aaed0edf87 100644 --- a/spec/helpers/gitlab_routing_helper_spec.rb +++ b/spec/helpers/gitlab_routing_helper_spec.rb @@ -1,48 +1,39 @@ require 'spec_helper' describe GitlabRoutingHelper do - describe 'Project URL helpers' do - describe '#project_members_url' do - let(:project) { build_stubbed(:empty_project) } - - it { expect(project_members_url(project)).to eq namespace_project_project_members_url(project.namespace, project) } - end + let(:project) { build_stubbed(:empty_project) } + let(:group) { build_stubbed(:group) } + describe 'Project URL helpers' do describe '#project_member_path' do let(:project_member) { create(:project_member) } - it { expect(project_member_path(project_member)).to eq namespace_project_project_member_path(project_member.source.namespace, project_member.source, project_member) } + it { expect(project_member_path(project_member)).to eq project_project_member_path(project_member.source, project_member) } end describe '#request_access_project_members_path' do - let(:project) { build_stubbed(:empty_project) } - - it { expect(request_access_project_members_path(project)).to eq request_access_namespace_project_project_members_path(project.namespace, project) } + it { expect(request_access_project_members_path(project)).to eq request_access_project_project_members_path(project) } end describe '#leave_project_members_path' do - let(:project) { build_stubbed(:empty_project) } - - it { expect(leave_project_members_path(project)).to eq leave_namespace_project_project_members_path(project.namespace, project) } + it { expect(leave_project_members_path(project)).to eq leave_project_project_members_path(project) } end describe '#approve_access_request_project_member_path' do let(:project_member) { create(:project_member) } - it { expect(approve_access_request_project_member_path(project_member)).to eq approve_access_request_namespace_project_project_member_path(project_member.source.namespace, project_member.source, project_member) } + it { expect(approve_access_request_project_member_path(project_member)).to eq approve_access_request_project_project_member_path(project_member.source, project_member) } end describe '#resend_invite_project_member_path' do let(:project_member) { create(:project_member) } - it { expect(resend_invite_project_member_path(project_member)).to eq resend_invite_namespace_project_project_member_path(project_member.source.namespace, project_member.source, project_member) } + it { expect(resend_invite_project_member_path(project_member)).to eq resend_invite_project_project_member_path(project_member.source, project_member) } end end describe 'Group URL helpers' do describe '#group_members_url' do - let(:group) { build_stubbed(:group) } - it { expect(group_members_url(group)).to eq group_group_members_url(group) } end @@ -53,14 +44,10 @@ describe GitlabRoutingHelper do end describe '#request_access_group_members_path' do - let(:group) { build_stubbed(:group) } - it { expect(request_access_group_members_path(group)).to eq request_access_group_group_members_path(group) } end describe '#leave_group_members_path' do - let(:group) { build_stubbed(:group) } - it { expect(leave_group_members_path(group)).to eq leave_group_group_members_path(group) } end @@ -76,4 +63,44 @@ describe GitlabRoutingHelper do it { expect(resend_invite_group_member_path(group_member)).to eq resend_invite_group_group_member_path(group_member.source, group_member) } end end + + 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 |