Commit e03fd21cba70eb683e961556a2f18327ae0420b1

Authored by Guilherme Rojas V. de Lima + Rafael Reggiani Manzo
Committed by Rafael Manzo
1 parent 35600e42

Projects routing

app/controllers/projects_controller.rb 0 → 100644
@@ -0,0 +1,3 @@ @@ -0,0 +1,3 @@
  1 +class ProjectsController < ApplicationController
  2 +
  3 +end
config/routes.rb
@@ -2,7 +2,7 @@ Mezuro::Application.routes.draw do @@ -2,7 +2,7 @@ Mezuro::Application.routes.draw do
2 devise_for :users 2 devise_for :users
3 3
4 root "home#index" 4 root "home#index"
5 - 5 + resources :projects
6 # The priority is based upon order of creation: first created -> highest priority. 6 # The priority is based upon order of creation: first created -> highest priority.
7 # See how all your routes lay out with "rake routes". 7 # See how all your routes lay out with "rake routes".
8 8
spec/routing/project_routing_spec.rb 0 → 100644
@@ -0,0 +1,33 @@ @@ -0,0 +1,33 @@
  1 +require "spec_helper"
  2 +
  3 +describe ProjectsController do
  4 + describe "routing" do
  5 + it 'should route to #new' do
  6 + get('/projects/new').should route_to('projects#new')
  7 + end
  8 +
  9 + it 'should route to #index' do
  10 + get('/projects').should route_to('projects#index')
  11 + end
  12 +
  13 + it 'should route to #create' do
  14 + post('/projects').should route_to('projects#create')
  15 + end
  16 +
  17 + it 'should route to #show' do
  18 + get('/projects/1').should route_to('projects#show', :id => "1")
  19 + end
  20 +
  21 + it 'should route to #edit' do
  22 + get('/projects/1/edit').should route_to('projects#edit', :id => "1")
  23 + end
  24 +
  25 + it 'should route to #update' do
  26 + put('/projects/1').should route_to('projects#update', :id => "1")
  27 + end
  28 +
  29 + it 'should route to #destroy' do
  30 + delete('/projects/1').should route_to('projects#destroy', :id => "1")
  31 + end
  32 + end
  33 +end
0 \ No newline at end of file 34 \ No newline at end of file