Commit 89aeed18 authored by James Lopez's avatar James Lopez

feature and fix for 500 on group missing

parent eb7f6690
...@@ -81,6 +81,7 @@ class GroupsController < Groups::ApplicationController ...@@ -81,6 +81,7 @@ class GroupsController < Groups::ApplicationController
def group def group
@group ||= Group.find_by(path: params[:id]) @group ||= Group.find_by(path: params[:id])
render_404 unless @group
end end
def load_projects def load_projects
......
...@@ -3,6 +3,11 @@ Feature: Explore Groups ...@@ -3,6 +3,11 @@ Feature: Explore Groups
Background: Background:
Given group "TestGroup" has private project "Enterprise" Given group "TestGroup" has private project "Enterprise"
Scenario: I should not see a group if it does not exist
When I sign in as a user
And I visit group "NonExistentGroup" page
Then page status code should be 404
Scenario: I should see group with private and internal projects as user Scenario: I should see group with private and internal projects as user
Given group "TestGroup" has internal project "Internal" Given group "TestGroup" has internal project "Internal"
When I sign in as a user When I sign in as a user
......
...@@ -26,6 +26,10 @@ class Spinach::Features::ExploreGroups < Spinach::FeatureSteps ...@@ -26,6 +26,10 @@ class Spinach::Features::ExploreGroups < Spinach::FeatureSteps
visit group_path(Group.find_by(name: "TestGroup")) visit group_path(Group.find_by(name: "TestGroup"))
end end
step 'I visit group "NonExistentGroup" page' do
visit group_path(-1)
end
step 'I visit group "TestGroup" issues page' do step 'I visit group "TestGroup" issues page' do
visit issues_group_path(Group.find_by(name: "TestGroup")) visit issues_group_path(Group.find_by(name: "TestGroup"))
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment