From ee1b89ae2b1b456d6cb1b9cdd931bd98a9295f07 Mon Sep 17 00:00:00 2001 From: Valery Sizov Date: Fri, 20 Oct 2017 16:39:01 +0300 Subject: Backport EE changes to group routes --- spec/routing/routing_spec.rb | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'spec/routing') diff --git a/spec/routing/routing_spec.rb b/spec/routing/routing_spec.rb index a45839b16f5..407d19c3b2a 100644 --- a/spec/routing/routing_spec.rb +++ b/spec/routing/routing_spec.rb @@ -285,17 +285,15 @@ end describe "Groups", "routing" do let(:name) { 'complex.group-namegit' } - - before do - allow_any_instance_of(GroupUrlConstrainer).to receive(:matches?).and_return(true) - end + let!(:group) { create(:group, name: name) } it "to #show" do expect(get("/groups/#{name}")).to route_to('groups#show', id: name) end it "also supports nested groups" do - expect(get("/#{name}/#{name}")).to route_to('groups#show', id: "#{name}/#{name}") + nested_group = create(:group, parent: group) + expect(get("/#{name}/#{nested_group.name}")).to route_to('groups#show', id: "#{name}/#{nested_group.name}") end it "also display group#show on the short path" do @@ -313,10 +311,6 @@ describe "Groups", "routing" do it "to #members" do expect(get("/groups/#{name}/group_members")).to route_to('groups/group_members#index', group_id: name) end - - it "also display group#show with slash in the path" do - expect(get('/group/subgroup')).to route_to('groups#show', id: 'group/subgroup') - end end describe HealthCheckController, 'routing' do -- cgit v1.2.1