Commit fb05d69e0e6c3c3b0862c373f5950d5a29bebab2

Authored by Rafael Manzo
1 parent f4bbf5a7

Tutorials structure

app/controllers/tutorials_controller.rb 0 → 100644
... ... @@ -0,0 +1,5 @@
  1 +class TutorialsController < ApplicationController
  2 + def view
  3 + render params[:name]
  4 + end
  5 +end
... ...
app/views/tutorials/project_customization.html.erb 0 → 100644
config/routes.rb
... ... @@ -33,6 +33,9 @@ Rails.application.routes.draw do
33 33 post '/modules/:id/metric_history' => 'modules#metric_history'
34 34 post '/modules/:id/tree' => 'modules#load_module_tree'
35 35  
  36 + # Tutorials
  37 + get '/tutorials/:name' => 'tutorials#view'
  38 +
36 39 root "home#index"
37 40  
38 41 # The priority is based upon order of creation: first created -> highest priority.
... ...
spec/controllers/tutorials_controller_spec.rb 0 → 100644
... ... @@ -0,0 +1,14 @@
  1 +require 'spec_helper'
  2 +
  3 +describe TutorialsController do
  4 + describe 'view' do
  5 + let!(:name) { "project_customization" }
  6 +
  7 + before :each do
  8 + get :view, name: name
  9 + end
  10 +
  11 + it { is_expected.to render_template(name) }
  12 + it { is_expected.to respond_with(:success) }
  13 + end
  14 +end
... ...
spec/routing/tutorials_routing_spec.rb 0 → 100644
... ... @@ -0,0 +1,8 @@
  1 +require "spec_helper"
  2 +
  3 +describe TutorialsController, :type => :routing do
  4 + describe "routing" do
  5 + it { is_expected.to route(:get, '/tutorials/project').
  6 + to(controller: :tutorials, action: :view, name: "project") }
  7 + end
  8 +end
0 9 \ No newline at end of file
... ...