Skip to content
Snippets Groups Projects
Commit 5d993ef9 authored by Rémy Coutable's avatar Rémy Coutable
Browse files

Fix groups/:id/activity route redirect

parent 2221ed87
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -2,12 +2,12 @@ class GroupsController < Groups::ApplicationController
include IssuesAction
include MergeRequestsAction
 
skip_before_action :authenticate_user!, only: [:activity, :issues, :merge_requests]
skip_before_action :authenticate_user!, only: [:show, :activity, :issues, :merge_requests]
respond_to :html
before_action :find_group, except: [:new, :create]
 
# Authorize
before_action :authorize_read_group!, except: [:activity, :new, :create, :autocomplete]
before_action :authorize_read_group!, except: [:show, :activity, :new, :create, :autocomplete]
before_action :authorize_admin_group!, only: [:edit, :update, :destroy]
before_action :authorize_create_group!, only: [:new, :create]
 
Loading
Loading
@@ -36,6 +36,10 @@ class GroupsController < Groups::ApplicationController
end
end
 
def show
redirect_to activity_group_path(@group)
end
def activity
@last_push = current_user.recent_push if current_user
 
Loading
Loading
Loading
Loading
@@ -344,7 +344,6 @@ Rails.application.routes.draw do
#
resources :groups, constraints: { id: /[a-zA-Z.0-9_\-]+(?<!\.atom)/ } do
member do
get :show, to: :activity
get :activity
get :issues
get :merge_requests
Loading
Loading
Loading
Loading
@@ -53,7 +53,7 @@ class Spinach::Features::DashboardGroup < Spinach::FeatureSteps
end
 
step 'I should be redirected to group "Samurai" page' do
expect(current_path).to eq group_path(Group.find_by(name: 'Samurai'))
expect(current_path).to eq activity_group_path(Group.find_by(name: 'Samurai'))
end
 
step 'I should see newly created group "Samurai"' do
Loading
Loading
Loading
Loading
@@ -240,11 +240,19 @@ describe "Authentication", "routing" do
end
 
describe "Groups", "routing" do
it "to #show" do
expect(get("/groups/1")).to route_to('groups#show', id: '1')
it "/groups/1" do
expect(get("/groups/1")).to route_to('groups#activity', id: '1')
end
it "/groups/1/activity" do
expect(get("/groups/1/activity")).to route_to('groups#activity', id: '1')
end
 
it "also display group#show on the short path" do
expect(get('/1')).to route_to('namespaces#show', id: '1')
end
it "/groups/1/projects" do
expect(get("/groups/1/projects")).to route_to('groups/projects#index', group_id: '1')
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment