sinatra-pages 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/lib/sinatra/pages.rb CHANGED
@@ -3,7 +3,7 @@ require 'haml'
3
3
 
4
4
  module Sinatra
5
5
  class Pages < Sinatra::Base
6
- get '/' do
6
+ get '/?' do
7
7
  haml :home
8
8
  end
9
9
  end
data/spec/pages_spec.rb CHANGED
@@ -13,16 +13,18 @@ describe Sinatra::Pages do
13
13
  end
14
14
 
15
15
  context "when using the HTTP GET request method" do
16
- it "should render the Home page if the given route is '/'" do
16
+ it "should render the Home page if the given route is either empty or root." do
17
17
  File.exist?('views/home.haml').should be_true
18
18
 
19
- get '/'
20
-
21
- last_response.should be_ok
22
- last_response.body.chomp.should == 'Home'
19
+ %w[/ /?].each do |route|
20
+ get route
21
+
22
+ last_response.should be_ok
23
+ last_response.body.chomp.should == 'Home'
24
+ end
23
25
  end
24
26
  end
25
-
27
+
26
28
  after :all do
27
29
  FileUtils.rm_r 'views', :force => true
28
30
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sinatra-pages
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julio Javier Cicchelli