OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
openproject/spec/routing/wiki_routing_spec.rb

48 lines
2.1 KiB

#-- copyright
# OpenProject is a project management system.
#
# Copyright (C) 2012-2013 the OpenProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License version 3.
#
# See doc/COPYRIGHT.rdoc for more details.
#++
require 'spec_helper'
describe WikiController do
describe "routing" do
it 'should connect GET /projects/:project_id/wiki/new to wiki/new' do
get('/projects/abc/wiki/new').should route_to(:controller => 'wiki',
:action => 'new',
:project_id => 'abc')
end
it 'should connect GET /projects/:project_id/wiki/:id/new to wiki/new_child' do
get('/projects/abc/wiki/def/new').should route_to(:controller => 'wiki',
:action => 'new_child',
:project_id => 'abc',
:id => 'def')
end
it 'should connect POST /projects/:project_id/wiki/new to wiki/create' do
post('/projects/abc/wiki/new').should route_to(:controller => 'wiki',
:action => 'create',
:project_id => 'abc')
end
it 'should contect POST /projects/:project_id/wiki/:id/preview to wiki/preview' do
post('/projects/abc/wiki/def/preview').should route_to(:controller => 'wiki',
:action => 'preview',
:project_id => 'abc',
:id => 'def')
end
it 'should contect POST /projects/:project_id/wiki/preview to wiki/preview' do
post('/projects/abc/wiki/preview').should route_to(:controller => 'wiki',
:action => 'preview',
:project_id => 'abc')
end
end
end