Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2015-04-11 23:49:03 +0300
committerRobert Speicher <rspeicher@gmail.com>2015-04-15 19:25:37 +0300
commite24cb79f3196052395829b35d51693dc9de5afbe (patch)
tree4b3d9762e0d9ed90476f3ece2a3ad81661e95268 /spec/routing/routing_spec.rb
parent1e27b68b364cfc0b504e7db429c2450d75b72cfd (diff)
Add constraints to help#show route parameters
Diffstat (limited to 'spec/routing/routing_spec.rb')
-rw-r--r--spec/routing/routing_spec.rb53
1 files changed, 19 insertions, 34 deletions
diff --git a/spec/routing/routing_spec.rb b/spec/routing/routing_spec.rb
index d4915b51952..b1225f101b7 100644
--- a/spec/routing/routing_spec.rb
+++ b/spec/routing/routing_spec.rb
@@ -64,50 +64,35 @@ describe SnippetsController, "routing" do
end
end
-# help GET /help(.:format) help#index
-# help_permissions GET /help/permissions(.:format) help#permissions
-# help_workflow GET /help/workflow(.:format) help#workflow
-# help_api GET /help/api(.:format) help#api
-# help_web_hooks GET /help/web_hooks(.:format) help#web_hooks
-# help_system_hooks GET /help/system_hooks(.:format) help#system_hooks
-# help_markdown GET /help/markdown(.:format) help#markdown
-# help_ssh GET /help/ssh(.:format) help#ssh
-# help_raketasks GET /help/raketasks(.:format) help#raketasks
+# help GET /help(.:format) help#index
+# help_page GET /help/:category/:file(.:format) help#show {:category=>/[^\.]+/, :file=>/[^\.]+/}
+# help_shortcuts GET /help/shortcuts(.:format) help#shortcuts
+# help_ui GET /help/ui(.:format) help#ui
describe HelpController, "routing" do
it "to #index" do
expect(get("/help")).to route_to('help#index')
end
- it "to #permissions" do
- expect(get("/help/permissions/permissions")).to route_to('help#show', category: "permissions", file: "permissions")
- end
-
- it "to #workflow" do
- expect(get("/help/workflow/README")).to route_to('help#show', category: "workflow", file: "README")
- end
-
- it "to #api" do
- expect(get("/help/api/README")).to route_to('help#show', category: "api", file: "README")
- end
-
- it "to #web_hooks" do
- expect(get("/help/web_hooks/web_hooks")).to route_to('help#show', category: "web_hooks", file: "web_hooks")
- end
-
- it "to #system_hooks" do
- expect(get("/help/system_hooks/system_hooks")).to route_to('help#show', category: "system_hooks", file: "system_hooks")
- end
+ it 'to #show' do
+ path = '/help/markdown/markdown.md'
+ expect(get(path)).to route_to('help#show',
+ category: 'markdown',
+ file: 'markdown',
+ format: 'md')
- it "to #markdown" do
- expect(get("/help/markdown/markdown")).to route_to('help#show',category: "markdown", file: "markdown")
+ path = '/help/workflow/protected_branches/protected_branches1.png'
+ expect(get(path)).to route_to('help#show',
+ category: 'workflow/protected_branches',
+ file: 'protected_branches1',
+ format: 'png')
end
- it "to #ssh" do
- expect(get("/help/ssh/README")).to route_to('help#show', category: "ssh", file: "README")
+ it 'to #shortcuts' do
+ expect(get('/help/shortcuts')).to route_to('help#shortcuts')
end
- it "to #raketasks" do
- expect(get("/help/raketasks/README")).to route_to('help#show', category: "raketasks", file: "README")
+ it 'to #ui' do
+ expect(get('/help/ui')).to route_to('help#ui')
end
end