rory 0.3.7 → 0.3.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -45,7 +45,9 @@ module Rory
45
45
 
46
46
  def controller
47
47
  if klass = controller_class
48
- klass.new(@request.merge(:dispatcher => self), @context)
48
+ request_for_delivery = @request.dup
49
+ request_for_delivery[:dispatcher] = self
50
+ klass.new(request_for_delivery, @context)
49
51
  end
50
52
  end
51
53
 
data/lib/rory/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Rory
2
- VERSION = '0.3.7'
2
+ VERSION = '0.3.8'
3
3
  end
data/rory.gemspec CHANGED
@@ -34,6 +34,7 @@ EOF
34
34
 
35
35
  s.add_development_dependency 'rake'
36
36
  s.add_development_dependency 'rspec'
37
+ s.add_development_dependency 'capybara'
37
38
  s.add_development_dependency 'yard'
38
39
  s.add_development_dependency 'reek'
39
40
  s.add_development_dependency 'simplecov'
@@ -78,7 +78,8 @@ describe Rory::Application do
78
78
  { :controller => 'awesome', :action => 'rad', :regex => /^this\/(?<path>[^\/]+)\/is\/(?<very_awesome>[^\/]+)$/},
79
79
  { :controller => 'lumpies', :action => 'show', :regex => /^lumpies\/(?<lump>[^\/]+)$/, :module => 'goose', :methods => [:get] },
80
80
  { :controller => 'rabbits', :action => 'chew', :regex => /^rabbits\/(?<chew>[^\/]+)$/, :module => 'goose/wombat', :methods => [:get] },
81
- { :controller => 'root', :action => 'vegetable', :regex => /^$/, :methods => [:get] }
81
+ { :controller => 'root', :action => 'vegetable', :regex => /^$/, :methods => [:get] },
82
+ { :controller => 'for_reals', :action => 'srsly', :regex => /^for_reals\/(?<parbles>[^\/]+)$/, :methods => [:get] }
82
83
  ].inspect
83
84
  end
84
85
  end
@@ -90,7 +91,7 @@ describe Rory::Application do
90
91
  end
91
92
  end
92
93
 
93
- describe '.autoload_paths' do
94
+ describe '.auto_require_paths' do
94
95
  after(:each) do
95
96
  Fixture::Application.instance.instance_variable_set(:@auto_require_paths, nil)
96
97
  end
@@ -9,4 +9,5 @@ Fixture::Application.set_routes do
9
9
  match 'rabbits/:chew', :to => 'rabbits#chew', :methods => [:get]
10
10
  end
11
11
  match '/', :to => 'root#vegetable', :methods => [:get]
12
+ match 'for_reals/:parbles', :to => 'for_reals#srsly', :methods => [:get]
12
13
  end
@@ -0,0 +1,5 @@
1
+ class ForRealsController < Rory::Controller
2
+ def srsly
3
+ @gibbit = @params[:parbles]
4
+ end
5
+ end
@@ -0,0 +1 @@
1
+ You've done it again, <%= @gibbit %>!
@@ -0,0 +1,9 @@
1
+ describe "Controller" do
2
+ describe "presentation", :type => :feature do
3
+ it 'renders action template' do
4
+ visit '/for_reals/pickles'
5
+
6
+ expect(page).to have_text("You've done it again, pickles!")
7
+ end
8
+ end
9
+ end
data/spec/spec_helper.rb CHANGED
@@ -5,6 +5,7 @@ ENV['RORY_STAGE'] = 'test'
5
5
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
6
6
  $LOAD_PATH.unshift(File.dirname(__FILE__))
7
7
  require 'rspec'
8
+ require 'capybara/rspec'
8
9
  require 'rory'
9
10
  require 'rack'
10
11
 
@@ -14,9 +15,10 @@ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
14
15
 
15
16
  require_relative 'fixture_app/config/application'
16
17
  Fixture::Application.root = File.join(File.dirname(__FILE__), 'fixture_app')
17
-
18
18
  Fixture::Application.require_all_files
19
19
 
20
+ Capybara.app = Fixture::Application
21
+
20
22
  RSpec.configure do |config|
21
23
 
22
24
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rory
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.7
4
+ version: 0.3.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -91,6 +91,22 @@ dependencies:
91
91
  - - ! '>='
92
92
  - !ruby/object:Gem::Version
93
93
  version: '0'
94
+ - !ruby/object:Gem::Dependency
95
+ name: capybara
96
+ requirement: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ! '>='
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
102
+ type: :development
103
+ prerelease: false
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
94
110
  - !ruby/object:Gem::Dependency
95
111
  name: yard
96
112
  requirement: !ruby/object:Gem::Requirement
@@ -188,13 +204,16 @@ files:
188
204
  - spec/dispatcher_spec.rb
189
205
  - spec/fixture_app/config/application.rb
190
206
  - spec/fixture_app/config/routes.rb
207
+ - spec/fixture_app/controllers/for_reals_controller.rb
191
208
  - spec/fixture_app/controllers/goose/lumpies_controller.rb
192
209
  - spec/fixture_app/controllers/goose/wombat/rabbits_controller.rb
193
210
  - spec/fixture_app/controllers/stub_controller.rb
211
+ - spec/fixture_app/views/for_reals/srsly.html.erb
194
212
  - spec/fixture_app/views/layouts/surround.html.erb
195
213
  - spec/fixture_app/views/test/dynamic.html.erb
196
214
  - spec/fixture_app/views/test/letsgo.html.erb
197
215
  - spec/fixture_app/views/test/static.html.erb
216
+ - spec/requests/controller_spec.rb
198
217
  - spec/rory_spec.rb
199
218
  - spec/spec_helper.rb
200
219
  - spec/support_spec.rb