From e03fd21cba70eb683e961556a2f18327ae0420b1 Mon Sep 17 00:00:00 2001 From: Guilherme Rojas V. de Lima + Rafael Reggiani Manzo Date: Wed, 31 Jul 2013 14:27:51 -0300 Subject: [PATCH] Projects routing --- app/controllers/projects_controller.rb | 3 +++ config/routes.rb | 2 +- spec/routing/project_routing_spec.rb | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 app/controllers/projects_controller.rb create mode 100644 spec/routing/project_routing_spec.rb diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb new file mode 100644 index 0000000..02fdf3a --- /dev/null +++ b/app/controllers/projects_controller.rb @@ -0,0 +1,3 @@ +class ProjectsController < ApplicationController + +end diff --git a/config/routes.rb b/config/routes.rb index 4c7c67b..9292ad4 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -2,7 +2,7 @@ Mezuro::Application.routes.draw do devise_for :users root "home#index" - + resources :projects # The priority is based upon order of creation: first created -> highest priority. # See how all your routes lay out with "rake routes". diff --git a/spec/routing/project_routing_spec.rb b/spec/routing/project_routing_spec.rb new file mode 100644 index 0000000..11dc809 --- /dev/null +++ b/spec/routing/project_routing_spec.rb @@ -0,0 +1,33 @@ +require "spec_helper" + +describe ProjectsController do + describe "routing" do + it 'should route to #new' do + get('/projects/new').should route_to('projects#new') + end + + it 'should route to #index' do + get('/projects').should route_to('projects#index') + end + + it 'should route to #create' do + post('/projects').should route_to('projects#create') + end + + it 'should route to #show' do + get('/projects/1').should route_to('projects#show', :id => "1") + end + + it 'should route to #edit' do + get('/projects/1/edit').should route_to('projects#edit', :id => "1") + end + + it 'should route to #update' do + put('/projects/1').should route_to('projects#update', :id => "1") + end + + it 'should route to #destroy' do + delete('/projects/1').should route_to('projects#destroy', :id => "1") + end + end +end \ No newline at end of file -- libgit2 0.21.2