File tree Expand file tree Collapse file tree 1 file changed +20
-2
lines changed Expand file tree Collapse file tree 1 file changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -165,8 +165,26 @@ class Dummy
165
165
end
166
166
end
167
167
168
- xdescribe '.route_param' do
169
- it 'does some thing'
168
+ describe '.route_param' do
169
+ it 'calls #namespace with given params' do
170
+ expect ( subject ) . to receive ( :namespace ) . with ( ':foo' , { } ) . and_yield
171
+ subject . route_param ( 'foo' , { } , &proc { } )
172
+ end
173
+
174
+ let ( :regex ) { /(.*)/ }
175
+ let! ( :options ) { { requirements : regex } }
176
+ it 'nests requirements option under param name' do
177
+ expect ( subject ) . to receive ( :namespace ) do |param , options |
178
+ expect ( options [ :requirements ] [ :foo ] ) . to eq regex
179
+ end
180
+ subject . route_param ( 'foo' , options , &proc { } )
181
+ end
182
+
183
+ it 'does not modify options parameter' do
184
+ allow ( subject ) . to receive ( :namespace )
185
+ expect { subject . route_param ( 'foo' , options , &proc { } ) }
186
+ . to_not change { options }
187
+ end
170
188
end
171
189
172
190
describe '.versions' do
You can’t perform that action at this time.
0 commit comments