Skip to content
This repository
Browse code

Updated travis gem numbers

  • Loading branch information...
commit 545a401cf74a00d2601e18dc27b368e9dda42452 1 parent 176895f
Harlow Ward harlow authored

Showing 2 changed files with 50 additions and 43 deletions. Show diff stats Hide diff stats

  1. +3 3 .travis.yml
  2. +47 40 spec/controllers/pages_controller_spec.rb
6 .travis.yml
@@ -4,6 +4,6 @@ rvm:
4 4 - 1.9.2
5 5 - 1.9.3
6 6 gemfile:
7   - - gemfiles/rails-3.0.12.gemfile
8   - - gemfiles/rails-3.1.4.gemfile
9   - - gemfiles/rails-3.2.3.gemfile
  7 + - gemfiles/rails-3.0.15.gemfile
  8 + - gemfiles/rails-3.1.6.gemfile
  9 + - gemfiles/rails-3.2.6.gemfile
87 spec/controllers/pages_controller_spec.rb
... ... @@ -1,112 +1,119 @@
1 1 # encoding: UTF-8
2   -
3 2 require 'spec_helper'
4 3
5 4 describe HighVoltage::PagesController do
6   -
7 5 render_views
8 6
9   - context "using default configuration" do
10   -
11   - describe "on GET to /pages/exists" do
  7 + context 'using default configuration' do
  8 + describe 'on GET to /pages/exists' do
12 9 before { get :show, :id => 'exists' }
13 10
14   - it "should respond with success and render template" do
  11 + it 'should respond with success and render template' do
15 12 response.should be_success
16 13 response.should render_template('exists')
17 14 end
18 15
19   - it "should use the default layout used by ApplicationController" do
20   - response.should render_template("layouts/application")
  16 + it 'should use the default layout used by ApplicationController' do
  17 + response.should render_template('layouts/application')
21 18 end
22 19 end
23 20
24   - describe "on GET to /pages/dir/nested" do
  21 + describe 'on GET to /pages/dir/nested' do
25 22 before { get :show, :id => 'dir/nested' }
26 23
27   - it "should respond with success and render template" do
  24 + it 'should respond with success and render template' do
28 25 response.should be_success
29 26 response.should render_template('pages/dir/nested')
30 27 end
31 28 end
32 29
33   - it "should raise a routing error for an invalid page" do
34   - lambda { get :show, :id => "invalid" }.should raise_error(ActionController::RoutingError)
  30 + it 'should raise a routing error for an invalid page' do
  31 + lambda { get :show, :id => 'invalid' }.should raise_error(ActionController::RoutingError)
35 32 end
36 33
37   - it "should raise a routing error for a page in another directory" do
38   - lambda { get :show, :id => "../other/wrong" }.should raise_error(ActionController::RoutingError)
  34 + it 'should raise a routing error for a page in another directory' do
  35 + lambda { get :show, :id => '../other/wrong' }.should raise_error(ActionController::RoutingError)
39 36 end
40 37
41   - it "should raise missing template error for valid page with invalid partial" do
42   - lambda { get :show, :id => "exists_but_references_nonexistent_partial" }.should raise_error(ActionView::MissingTemplate)
  38 + it 'should raise missing template error for valid page with invalid partial' do
  39 + lambda { get :show, :id => 'exists_but_references_nonexistent_partial' }.should raise_error(ActionView::MissingTemplate)
43 40 end
44 41 end
45 42
46   - context "using custom layout" do
  43 + context 'using custom layout' do
47 44 before(:all) do
48 45 @original_layout = HighVoltage.layout
49   - HighVoltage.layout = "alternate"
  46 + HighVoltage.layout = 'alternate'
50 47 end
51 48
52 49 after(:all) do
53 50 HighVoltage.layout = @original_layout
54 51 end
55 52
56   - describe "on GET to /pages/exists" do
57   - before { get :show, :id => "exists" }
58   -
59   - it "should use the custom configured layout" do
60   - response.should_not render_template("layouts/application")
61   - response.should render_template("layouts/alternate")
  53 + describe 'on GET to /pages/exists' do
  54 + before { get :show, :id => 'exists' }
  55 +
  56 + it 'should use the custom configured layout' do
  57 + response.should_not render_template('layouts/application')
  58 + response.should render_template('layouts/alternate')
62 59 end
63 60 end
64 61 end
65 62
66   - context "using custom content path" do
  63 + context 'using custom content path' do
67 64 before(:all) do
68 65 @original_content_path = HighVoltage.content_path
69   - HighVoltage.content_path = "other_pages/"
  66 + HighVoltage.content_path = 'other_pages/'
70 67 end
71 68
72 69 after(:all) do
73 70 HighVoltage.content_path = @original_content_path
74 71 end
75 72
76   - describe "on GET to /other_pages/also_exists" do
  73 + describe 'on GET to /other_pages/also_exists' do
77 74 before { get :show, :id => 'also_exists' }
78 75
79   - it "should respond with success and render template" do
  76 + it 'should respond with success and render template' do
80 77 response.should be_success
81 78 response.should render_template('other_pages/also_exists')
82 79 end
83 80 end
84 81
85   - describe "on GET to /other_pages/also_dir/nested" do
  82 + describe 'on GET to /other_pages/also_dir/nested' do
86 83 before { get :show, :id => 'also_dir/also_nested' }
87 84
88   - it "should respond with success and render template" do
  85 + it 'should respond with success and render template' do
89 86 response.should be_success
90 87 response.should render_template('other_pages/also_dir/also_nested')
91 88 end
92 89 end
93 90
94   - it "should raise a routing error for an invalid page" do
95   - lambda { get :show, :id => "also_invalid" }.should raise_error(ActionController::RoutingError)
  91 + it 'should raise a routing error for an invalid page' do
  92 + lambda {
  93 + get :show,
  94 + :id => 'also_invalid'
  95 + }.should raise_error(ActionController::RoutingError)
96 96 end
97 97
98   - it "should raise a routing error for a page in another directory" do
99   - lambda { get :show, :id => "../other/wrong" }.should raise_error(ActionController::RoutingError)
  98 + it 'should raise a routing error for a page in another directory' do
  99 + lambda {
  100 + get :show,
  101 + :id => '../other/wrong'
  102 + }.should raise_error(ActionController::RoutingError)
100 103 end
101 104
102   - it "should raise a routing error for a page in another directory when using a Unicode exploit" do
103   - lambda { get :show, :id => "/\\../other/wrong" }.should raise_error(ActionController::RoutingError)
  105 + it 'should raise a routing error for a page in another directory when using a Unicode exploit' do
  106 + lambda {
  107 + get :show,
  108 + :id => '/\\../other/wrong'
  109 + }.should raise_error(ActionController::RoutingError)
104 110 end
105 111
106   - it "should raise missing template error for valid page with invalid partial" do
107   - lambda { get :show, :id => "also_exists_but_references_nonexistent_partial" }.should raise_error(ActionView::MissingTemplate)
  112 + it 'should raise missing template error for valid page with invalid partial' do
  113 + lambda {
  114 + get :show,
  115 + :id => 'also_exists_but_references_nonexistent_partial'
  116 + }.should raise_error(ActionView::MissingTemplate)
108 117 end
109 118 end
110   -
111   -
112 119 end

0 comments on commit 545a401

Please sign in to comment.
Something went wrong with that request. Please try again.