Commit fb05d69e0e6c3c3b0862c373f5950d5a29bebab2
1 parent
f4bbf5a7
Exists in
colab
and in
4 other branches
Tutorials structure
Showing
5 changed files
with
30 additions
and
0 deletions
Show diff stats
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. | ... | ... |
| ... | ... | @@ -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 | ... | ... |
| ... | ... | @@ -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 | ... | ... |