GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Rubygem
Description: Resource-oriented open source Ruby framework for Web apps.
Homepage: http://rubywaves.com/
Clone URL: git://github.com/dyoder/waves.git
change spec to use symbol keys for params
automatthew (author)
Tue Aug 26 07:36:01 -0700 2008
commit  c04be42adcd50bce7356e8a8c9edff3d5a45bf1a
tree    635fe8d4b5fdbcb835bd8df00efd3f8a06be507e
parent  abbc9fe60a28abce92929137f7cbbd479d496776
...
105
106
107
108
 
 
109
110
111
...
114
115
116
117
 
118
119
120
...
133
134
135
136
 
137
138
139
...
105
106
107
 
108
109
110
111
112
...
115
116
117
 
118
119
120
121
...
134
135
136
 
137
138
139
140
0
@@ -105,7 +105,8 @@ describe "In a mapping's path-matcher" do
0
       it "may use hash placeholder with value of true, to glom up all remaining components" do
0
         mappings do
0
           on( :get => [ :first, { :rest => true } ] ) do
0
- [ params['first'], params['rest'].join('-') ].join(', ')
0
+ # puts params.inspect
0
+ [ params[:first], params[:rest].join('-') ].join(', ')
0
           end
0
         end
0
         
0
@@ -114,7 +115,7 @@ describe "In a mapping's path-matcher" do
0
       
0
       it "saves placeholder matches as params" do
0
         mappings do
0
- on( :get => [ :critter, :name ]) { "#{params['critter']}, #{params['name']}" }
0
+ on( :get => [ :critter, :name ]) { "#{params[:critter]}, #{params[:name]}" }
0
         end
0
         
0
         mock_request.get('/dwarf/tyrion').body.should == "dwarf, tyrion"
0
@@ -133,7 +134,7 @@ describe "In a mapping's path-matcher" do
0
       
0
       it "can apparently also use hashes to set default values" do
0
         mappings do
0
- on( :get => [ "thingy", { :mode => 'show' } ] ) { "mode: #{params['mode']}" }
0
+ on( :get => [ "thingy", { :mode => 'show' } ] ) { "mode: #{params[:mode]}" }
0
         end
0
         
0
         mock_request.get("/thingy").body.should == "mode: show"

Comments

    No one has commented yet.