summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRodrigo Souto <rodrigo@colivre.coop.br>2016-02-17 15:39:18 -0300
committerRémy Coutable <remy@rymai.me>2016-03-16 13:19:38 +0100
commit18531744d7e90b963ba6b45ecf49913f6bfcefbf (patch)
tree27d0c4baf7c3466037b4e1d1724de3d4cc86f429
parenta34021cd182af49fc732c4ad58f7594f73c46f01 (diff)
downloadgitlab-ce-diguliu/gitlab-ce-make-grouped-milestone-public.tar.gz
Make grouped milestone page publicdiguliu/gitlab-ce-make-grouped-milestone-public
Grouped milestone page now will skip authentication. Solves #13403 which was a created in response to https://gitlab.com/gitlab-com/www-gitlab-com/issues/554
-rw-r--r--CHANGELOG1
-rw-r--r--app/controllers/groups/milestones_controller.rb1
-rw-r--r--spec/controllers/groups/milestones_controller_spec.rb40
3 files changed, 32 insertions, 10 deletions
diff --git a/CHANGELOG b/CHANGELOG
index fcf659c07f9..c73b54ba832 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -33,6 +33,7 @@ v 8.6.0 (unreleased)
- Fix bug where Bitbucket `closed` issues were imported as `opened` (Iuri de Silvio)
- Don't show Issues/MRs from archived projects in Groups view
- Fix wrong "iid of max iid" in Issuable sidebar for some merged MRs
+ - Make grouped milestone page public (Rodrigo Souto)
- Increase the notes polling timeout over time (Roberto Dip)
- Add shortcut to toggle markdown preview (Florent Baldino)
- Show labels in dashboard and group milestone views
diff --git a/app/controllers/groups/milestones_controller.rb b/app/controllers/groups/milestones_controller.rb
index 0c2a350bc39..2e487520245 100644
--- a/app/controllers/groups/milestones_controller.rb
+++ b/app/controllers/groups/milestones_controller.rb
@@ -1,6 +1,7 @@
class Groups::MilestonesController < Groups::ApplicationController
include GlobalMilestones
+ skip_before_action :authenticate_user!, only: [:show]
before_action :projects
before_action :milestones, only: [:index]
before_action :milestone, only: [:show, :update]
diff --git a/spec/controllers/groups/milestones_controller_spec.rb b/spec/controllers/groups/milestones_controller_spec.rb
index eb0c6ac6d80..afd48e3567f 100644
--- a/spec/controllers/groups/milestones_controller_spec.rb
+++ b/spec/controllers/groups/milestones_controller_spec.rb
@@ -8,20 +8,40 @@ describe Groups::MilestonesController do
let(:title) { '肯定不是中文的问题' }
before do
- sign_in(user)
- group.add_owner(user)
- project.team << [user, :master]
controller.instance_variable_set(:@group, group)
end
- describe "#create" do
- it "should create group milestone with Chinese title" do
- post :create,
- group_id: group.id,
- milestone: { project_ids: [project.id, project2.id], title: title }
+ context 'unauthenticated user' do
+ describe "#show" do
+ it "should display milestone" do
+ create(:milestone, title: title, project: project)
- expect(response).to redirect_to(group_milestone_path(group, title.to_slug.to_s, title: title))
- expect(Milestone.where(title: title).count).to eq(2)
+ get :show,
+ group_id: group.id,
+ id: title,
+ title: title
+
+ expect(response).to be_success
+ end
+ end
+ end
+
+ context 'project owner' do
+ before do
+ sign_in(user)
+ group.add_owner(user)
+ project.team << [user, :master]
+ end
+
+ describe "#create" do
+ it "should create group milestone with Chinese title" do
+ post :create,
+ group_id: group.id,
+ milestone: { project_ids: [project.id, project2.id], title: title }
+
+ expect(response).to redirect_to(group_milestone_path(group, title.to_slug.to_s, title: title))
+ expect(Milestone.where(title: title).count).to eq(2)
+ end
end
end
end