tred-fancyroutes 0.9.1 → 0.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/lib/fancyroutes.rb CHANGED
@@ -47,8 +47,8 @@ module FancyRoutes
47
47
  def apply(rails_map)
48
48
  rails_map.send( (@name ? @name : :connect),
49
49
  @segments.join("/"), {
50
- :controller => @controller,
51
- :action => @action,
50
+ :controller => @controller.underscore,
51
+ :action => @action.underscore,
52
52
  :conditions => { :method => @request_method }
53
53
  }
54
54
  )
@@ -58,7 +58,7 @@ module FancyRoutes
58
58
  def copy
59
59
  Marshal::load(Marshal.dump(self))
60
60
  end
61
-
61
+
62
62
  end
63
63
 
64
64
  class RootRoute < Route
@@ -96,11 +96,19 @@ describe "FancyRoutes" do
96
96
  end
97
97
  end
98
98
 
99
- example "with named segment" do
100
- expect :get, 'my_controller/:image', 'my_controller', 'my_action'
99
+ example "with named segments" do
100
+ expect :get, 'my_controller/my_action', 'my_controller', 'my_action'
101
101
 
102
102
  fancyroutes do
103
- get / {'my_controller' => :controller} / :image > :my_action
103
+ get / {'my_controller' => :controller} / {'my_action' => :action}
104
+ end
105
+ end
106
+
107
+ example "with named segments using dashes" do
108
+ expect :get, 'my-controller/my-action', 'my_controller', 'my_action'
109
+
110
+ fancyroutes do
111
+ get / {'my-controller' => :controller} / {'my-action' => :action}
104
112
  end
105
113
  end
106
114
 
data/spec/spec_helper.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  $:.push File.join(File.dirname(__FILE__), '..', 'lib')
2
2
  require 'rubygems'
3
3
  require 'fancyroutes'
4
+ require 'activesupport'
4
5
 
5
6
  Spec::Runner.configure do |config|
6
7
  config.mock_with :rr
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tred-fancyroutes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 0.9.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - The TRED Team
@@ -9,7 +9,7 @@ autorequire: fancyroutes
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-03-09 00:00:00 -07:00
12
+ date: 2009-04-20 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies: []
15
15