merb-core 0.9.6 → 0.9.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. data/CHANGELOG +67 -0
  2. data/CONTRIBUTORS +1 -0
  3. data/PUBLIC_CHANGELOG +34 -0
  4. data/Rakefile +7 -4
  5. data/bin/merb +1 -31
  6. data/lib/merb-core.rb +17 -6
  7. data/lib/merb-core/config.rb +0 -7
  8. data/lib/merb-core/controller/abstract_controller.rb +6 -3
  9. data/lib/merb-core/dispatch/cookies.rb +11 -10
  10. data/lib/merb-core/dispatch/dispatcher.rb +11 -5
  11. data/lib/merb-core/dispatch/request.rb +7 -2
  12. data/lib/merb-core/dispatch/session.rb +33 -17
  13. data/lib/merb-core/dispatch/session/container.rb +19 -9
  14. data/lib/merb-core/dispatch/session/cookie.rb +27 -12
  15. data/lib/merb-core/dispatch/session/memcached.rb +47 -27
  16. data/lib/merb-core/dispatch/session/memory.rb +10 -6
  17. data/lib/merb-core/dispatch/session/store_container.rb +25 -20
  18. data/lib/merb-core/test/helpers/request_helper.rb +6 -3
  19. data/lib/merb-core/test/helpers/route_helper.rb +1 -1
  20. data/lib/merb-core/test/matchers/view_matchers.rb +5 -1
  21. data/lib/merb-core/version.rb +1 -1
  22. data/spec/private/dispatch/fixture/log/merb_test.log +144 -0
  23. data/spec/private/router/fixture/log/merb_test.log +16 -0
  24. data/spec/public/controller/controllers/cookies.rb +14 -3
  25. data/spec/public/controller/cookies_spec.rb +53 -10
  26. data/spec/public/controller/url_spec.rb +6 -0
  27. data/spec/public/directory_structure/directory/log/merb_test.log +112 -0
  28. data/spec/public/reloading/directory/log/merb_test.log +16 -0
  29. data/spec/public/request/request_spec.rb +19 -10
  30. data/spec/public/router/fixture/log/merb_test.log +224 -0
  31. data/spec/public/session/controllers/sessions.rb +4 -0
  32. data/spec/public/session/memcached_session_spec.rb +2 -2
  33. data/spec/public/session/multiple_sessions_spec.rb +2 -2
  34. data/spec/public/session/session_spec.rb +15 -0
  35. data/spec/public/test/request_helper_spec.rb +21 -0
  36. data/spec/public/test/route_helper_spec.rb +7 -0
  37. metadata +6 -17
  38. data/lib/merb-core/script.rb +0 -112
@@ -17,3 +17,19 @@ Fri, 05 Sep 2008 23:42:49 GMT ~ info ~ Logfile created
17
17
  ~ Starting Merb server listening at 0.0.0.0:4000
18
18
  ~ Starting Merb server listening at 0.0.0.0:4000
19
19
  ~ Starting Merb server listening at 0.0.0.0:4000
20
+ ~ Starting Merb server listening at 0.0.0.0:4000
21
+ ~ Starting Merb server listening at 0.0.0.0:4000
22
+ ~ Starting Merb server listening at 0.0.0.0:4000
23
+ ~ Starting Merb server listening at 0.0.0.0:4000
24
+ ~ Starting Merb server listening at 0.0.0.0:4000
25
+ ~ Starting Merb server listening at 0.0.0.0:4000
26
+ ~ Starting Merb server listening at 0.0.0.0:4000
27
+ ~ Starting Merb server listening at 0.0.0.0:4000
28
+ ~ Starting Merb server listening at 0.0.0.0:4000
29
+ ~ Starting Merb server listening at 0.0.0.0:4000
30
+ ~ Starting Merb server listening at 0.0.0.0:4000
31
+ ~ Starting Merb server listening at 0.0.0.0:4000
32
+ ~ Starting Merb server listening at 0.0.0.0:4000
33
+ ~ Starting Merb server listening at 0.0.0.0:4000
34
+ ~ Starting Merb server listening at 0.0.0.0:4000
35
+ ~ Starting Merb server listening at 0.0.0.0:4000
@@ -7,8 +7,14 @@ module Merb::Test::Fixtures::Controllers
7
7
  class CookiesController < Testing
8
8
 
9
9
  def store_cookies
10
+ cookies.set_cookie(:awesome, 'super-cookie', :domain => 'blog.merbivore.com')
10
11
  cookies[:foo] = 'bar'
11
- cookies.set_cookie(:awesome, 'super-cookie', :domain => 'blog.merbivore.com')
12
+ cookies.set_cookie(:oldcookie, 'this is really old', :expires => Time.utc(2020))
13
+ cookies.set_cookie(:safecook, 'no-hackers-here', :secure => true)
14
+ end
15
+
16
+ def destroy_cookies
17
+ cookies.delete(:foo)
12
18
  end
13
19
 
14
20
  def retrieve_cookies
@@ -16,10 +22,15 @@ module Merb::Test::Fixtures::Controllers
16
22
 
17
23
  end
18
24
 
19
- class OverridingSessionCookieDomain < CookiesController
25
+ class OverridingDefaultCookieDomain < CookiesController
20
26
  self._default_cookie_domain = "overridden.merbivore.com"
21
27
  end
22
28
 
23
- class NotOverridingSessionCookieDomain < CookiesController
29
+ class NotOverridingDefaultCookieDomain < CookiesController
24
30
  end
31
+
32
+ class EmptyDefaultCookieDomain < CookiesController
33
+ self._default_cookie_domain = ''
34
+ end
35
+
25
36
  end
@@ -13,28 +13,56 @@ describe Merb::Controller, "._default_cookie_domain" do
13
13
  end
14
14
 
15
15
  it "can be overridden for particular controller" do
16
- Merb::Test::Fixtures::Controllers::OverridingSessionCookieDomain._default_cookie_domain.should ==
16
+ Merb::Test::Fixtures::Controllers::OverridingDefaultCookieDomain._default_cookie_domain.should ==
17
17
  "overridden.merbivore.com"
18
18
  end
19
19
 
20
20
  it 'is inherited by subclasses unless overriden' do
21
- Merb::Test::Fixtures::Controllers::NotOverridingSessionCookieDomain._default_cookie_domain.should ==
21
+ Merb::Test::Fixtures::Controllers::NotOverridingDefaultCookieDomain._default_cookie_domain.should ==
22
22
  Merb::Config[:default_cookie_domain]
23
23
  end
24
24
  end
25
25
 
26
- describe Merb::Controller, "#cookies" do
26
+ describe Merb::Controller, "#cookies creating" do
27
27
 
28
- it "sets the Set-Cookie response header" do
29
- controller_klass = Merb::Test::Fixtures::Controllers::CookiesController
28
+ it "should set all the cookies for a request" do
29
+ controller = dispatch_to(Merb::Test::Fixtures::Controllers::CookiesController, :store_cookies)
30
+ controller.headers['Set-Cookie'].length.should == 4
31
+ end
32
+
33
+ it "should set a simple cookie" do
34
+ controller = dispatch_to(Merb::Test::Fixtures::Controllers::CookiesController, :store_cookies)
35
+ cookie = controller.headers['Set-Cookie'].sort[1]
36
+ cookie.should match(/foo=bar;/)
37
+ cookie.should match(/domain=specs.merbivore.com;/)
38
+ end
39
+
40
+ it "should set the cookie domain correctly when it is specified" do
41
+ controller = dispatch_to(Merb::Test::Fixtures::Controllers::CookiesController, :store_cookies)
42
+ cookie = controller.headers['Set-Cookie'].sort[0]
43
+ cookie.should match(/awesome=super-cookie;/)
44
+ cookie.should match(/domain=blog.merbivore.com;/)
45
+ end
46
+
47
+ it "should format the expires time to the correct format" do
48
+ controller = dispatch_to(Merb::Test::Fixtures::Controllers::CookiesController, :store_cookies)
49
+ cookie = controller.headers['Set-Cookie'].sort[2]
50
+ cookie.should include("oldcookie=this+is+really+old;")
51
+ cookie.should include("expires=Wed, 01-Jan-2020 00:00:00 GMT;")
52
+ end
53
+
54
+ it "should append secure to the end of the cookie header when marked as such" do
55
+ controller = dispatch_to(Merb::Test::Fixtures::Controllers::CookiesController, :store_cookies)
56
+ cookie = controller.headers['Set-Cookie'].sort[3]
57
+ cookie.should match(/secure$/)
58
+ end
59
+
60
+ it "sets the Set-Cookie response header - and ignores blank options" do
61
+ controller_klass = Merb::Test::Fixtures::Controllers::EmptyDefaultCookieDomain
30
62
  with_cookies(controller_klass) do |cookie_jar|
31
63
  controller = dispatch_to(controller_klass, :store_cookies)
32
64
  cookies = controller.headers['Set-Cookie'].sort
33
- cookies.length.should == 2
34
- cookies[0].should match(/awesome=super-cookie;/)
35
- cookies[0].should match(/domain=blog.merbivore.com;/)
36
- cookies[1].should match(/foo=bar;/)
37
- cookies[1].should match(/domain=specs.merbivore.com;/)
65
+ cookies[1].should == "foo=bar; path=/;"
38
66
  end
39
67
  end
40
68
 
@@ -50,3 +78,18 @@ describe Merb::Controller, "#cookies" do
50
78
  end
51
79
 
52
80
  end
81
+
82
+ describe Merb::Controller, "#cookies destroying" do
83
+
84
+ it "should send a cookie when deleting a cookie" do
85
+ controller = dispatch_to(Merb::Test::Fixtures::Controllers::CookiesController, :destroy_cookies)
86
+ controller.headers['Set-Cookie'].length.should == 1
87
+ end
88
+
89
+ it "should set the expiration time of the cookie being destroyed to the past" do
90
+ controller = dispatch_to(Merb::Test::Fixtures::Controllers::CookiesController, :destroy_cookies)
91
+ cookie = controller.headers['Set-Cookie'].sort[0]
92
+ cookie.should include("expires=Thu, 01-Jan-1970 00:00:00 GMT;")
93
+ end
94
+
95
+ end
@@ -246,4 +246,10 @@ describe Merb::Controller, "absolute_url" do
246
246
  :format => :xml,
247
247
  :protocol => "https").should == "https://localhost/monkeys/45.xml"
248
248
  end
249
+
250
+ it "allows passing an object instead of a hash" do
251
+ @monkey = Monkey.new
252
+ @controller.absolute_url(:monkey, @monkey).should == "http://localhost/monkeys/45"
253
+ end
254
+
249
255
  end
@@ -4474,3 +4474,115 @@ Restarting Worker Thread
4474
4474
  ~ {:after_filters_time=>6.0e-06, :action_time=>0.0007, :before_filters_time=>5.0e-06}
4475
4475
  ~ Params: {"action"=>"template", "controller"=>"custom"}
4476
4476
  ~ {:after_filters_time=>1.0e-05, :action_time=>0.000725, :before_filters_time=>1.0e-05}
4477
+ ~ Starting Merb server listening at 0.0.0.0:4000
4478
+ ~ Params: {"action"=>"string", "controller"=>"base"}
4479
+ ~ {:action_time=>0.000228, :before_filters_time=>1.6e-05, :after_filters_time=>1.5e-05}
4480
+ ~ Params: {"action"=>"template", "controller"=>"base"}
4481
+ ~ {:action_time=>0.000694, :before_filters_time=>5.0e-06, :after_filters_time=>5.0e-06}
4482
+ ~ Params: {"action"=>"template", "controller"=>"custom"}
4483
+ ~ {:action_time=>0.000722, :before_filters_time=>9.0e-06, :after_filters_time=>1.0e-05}
4484
+ ~ Starting Merb server listening at 0.0.0.0:4000
4485
+ ~ Params: {"action"=>"string", "controller"=>"base"}
4486
+ ~ {:action_time=>0.00024, :before_filters_time=>1.6e-05, :after_filters_time=>1.4e-05}
4487
+ ~ Params: {"action"=>"template", "controller"=>"base"}
4488
+ ~ {:action_time=>0.000793, :before_filters_time=>6.0e-06, :after_filters_time=>6.0e-06}
4489
+ ~ Params: {"action"=>"template", "controller"=>"custom"}
4490
+ ~ {:action_time=>0.000741, :before_filters_time=>1.0e-05, :after_filters_time=>1.1e-05}
4491
+ ~ Starting Merb server listening at 0.0.0.0:4000
4492
+ ~ Params: {"action"=>"string", "controller"=>"base"}
4493
+ ~ {:action_time=>0.000245, :before_filters_time=>1.7e-05, :after_filters_time=>1.6e-05}
4494
+ ~ Params: {"action"=>"template", "controller"=>"base"}
4495
+ ~ {:action_time=>0.0009, :before_filters_time=>6.0e-06, :after_filters_time=>6.0e-06}
4496
+ ~ Params: {"action"=>"template", "controller"=>"custom"}
4497
+ ~ {:action_time=>0.000965, :before_filters_time=>1.1e-05, :after_filters_time=>1.3e-05}
4498
+ ~ Starting Merb server listening at 0.0.0.0:4000
4499
+ ~ Params: {"action"=>"string", "controller"=>"base"}
4500
+ ~ {:action_time=>0.000255, :before_filters_time=>2.0e-05, :after_filters_time=>1.8e-05}
4501
+ ~ Params: {"action"=>"template", "controller"=>"base"}
4502
+ ~ {:action_time=>0.000739, :before_filters_time=>7.0e-06, :after_filters_time=>8.0e-06}
4503
+ ~ Params: {"action"=>"template", "controller"=>"custom"}
4504
+ ~ {:action_time=>0.000707, :before_filters_time=>1.3e-05, :after_filters_time=>1.3e-05}
4505
+ ~ Starting Merb server listening at 0.0.0.0:4000
4506
+ ~ Params: {"action"=>"string", "controller"=>"base"}
4507
+ ~ {:action_time=>0.000235, :before_filters_time=>1.7e-05, :after_filters_time=>1.4e-05}
4508
+ ~ Params: {"action"=>"template", "controller"=>"base"}
4509
+ ~ {:action_time=>0.000751, :before_filters_time=>5.0e-06, :after_filters_time=>5.0e-06}
4510
+ ~ Params: {"action"=>"template", "controller"=>"custom"}
4511
+ ~ {:action_time=>0.000722, :before_filters_time=>9.0e-06, :after_filters_time=>1.0e-05}
4512
+ ~ Starting Merb server listening at 0.0.0.0:4000
4513
+ ~ Params: {"action"=>"string", "controller"=>"base"}
4514
+ ~ {:action_time=>0.000232, :before_filters_time=>1.7e-05, :after_filters_time=>1.5e-05}
4515
+ ~ Params: {"action"=>"template", "controller"=>"base"}
4516
+ ~ {:action_time=>0.000729, :before_filters_time=>4.0e-06, :after_filters_time=>5.0e-06}
4517
+ ~ Params: {"action"=>"template", "controller"=>"custom"}
4518
+ ~ {:action_time=>0.000793, :before_filters_time=>1.1e-05, :after_filters_time=>1.1e-05}
4519
+ ~ Starting Merb server listening at 0.0.0.0:4000
4520
+ ~ Params: {"action"=>"string", "controller"=>"base"}
4521
+ ~ {:action_time=>0.000921, :before_filters_time=>1.5e-05, :after_filters_time=>1.5e-05}
4522
+ ~ Params: {"action"=>"template", "controller"=>"base"}
4523
+ ~ {:action_time=>0.000832, :before_filters_time=>6.0e-06, :after_filters_time=>6.0e-06}
4524
+ ~ Params: {"action"=>"template", "controller"=>"custom"}
4525
+ ~ {:action_time=>0.000705, :before_filters_time=>9.0e-06, :after_filters_time=>1.1e-05}
4526
+ ~ Starting Merb server listening at 0.0.0.0:4000
4527
+ ~ Params: {"action"=>"string", "controller"=>"base"}
4528
+ ~ {:action_time=>0.000232, :before_filters_time=>1.6e-05, :after_filters_time=>1.5e-05}
4529
+ ~ Params: {"action"=>"template", "controller"=>"base"}
4530
+ ~ {:action_time=>0.000721, :before_filters_time=>4.0e-06, :after_filters_time=>5.0e-06}
4531
+ ~ Params: {"action"=>"template", "controller"=>"custom"}
4532
+ ~ {:action_time=>0.00069, :before_filters_time=>9.0e-06, :after_filters_time=>1.0e-05}
4533
+ ~ Starting Merb server listening at 0.0.0.0:4000
4534
+ ~ Params: {"action"=>"string", "controller"=>"base"}
4535
+ ~ {:action_time=>0.000247, :before_filters_time=>1.6e-05, :after_filters_time=>1.5e-05}
4536
+ ~ Params: {"action"=>"template", "controller"=>"base"}
4537
+ ~ {:action_time=>0.000725, :before_filters_time=>5.0e-06, :after_filters_time=>6.0e-06}
4538
+ ~ Params: {"action"=>"template", "controller"=>"custom"}
4539
+ ~ {:action_time=>0.000725, :before_filters_time=>9.0e-06, :after_filters_time=>1.0e-05}
4540
+ ~ Starting Merb server listening at 0.0.0.0:4000
4541
+ ~ Params: {"action"=>"string", "controller"=>"base"}
4542
+ ~ {:after_filters_time=>1.4e-05, :action_time=>0.000232, :before_filters_time=>1.6e-05}
4543
+ ~ Params: {"action"=>"template", "controller"=>"base"}
4544
+ ~ {:after_filters_time=>6.0e-06, :action_time=>0.000781, :before_filters_time=>5.0e-06}
4545
+ ~ Params: {"action"=>"template", "controller"=>"custom"}
4546
+ ~ {:after_filters_time=>1.2e-05, :action_time=>0.000943, :before_filters_time=>1.0e-05}
4547
+ ~ Starting Merb server listening at 0.0.0.0:4000
4548
+ ~ Params: {"action"=>"string", "controller"=>"base"}
4549
+ ~ {:after_filters_time=>1.4e-05, :action_time=>0.000235, :before_filters_time=>1.5e-05}
4550
+ ~ Params: {"action"=>"template", "controller"=>"base"}
4551
+ ~ {:after_filters_time=>5.0e-06, :action_time=>0.000703, :before_filters_time=>6.0e-06}
4552
+ ~ Params: {"action"=>"template", "controller"=>"custom"}
4553
+ ~ {:after_filters_time=>1.0e-05, :action_time=>0.000693, :before_filters_time=>1.0e-05}
4554
+ ~ Starting Merb server listening at 0.0.0.0:4000
4555
+ ~ Params: {"action"=>"string", "controller"=>"base"}
4556
+ ~ {:after_filters_time=>1.4e-05, :action_time=>0.000227, :before_filters_time=>1.5e-05}
4557
+ ~ Params: {"action"=>"template", "controller"=>"base"}
4558
+ ~ {:after_filters_time=>6.0e-06, :action_time=>0.000712, :before_filters_time=>6.0e-06}
4559
+ ~ Params: {"action"=>"template", "controller"=>"custom"}
4560
+ ~ {:after_filters_time=>1.1e-05, :action_time=>0.000696, :before_filters_time=>9.0e-06}
4561
+ ~ Starting Merb server listening at 0.0.0.0:4000
4562
+ ~ Params: {"action"=>"string", "controller"=>"base"}
4563
+ ~ {:after_filters_time=>1.4e-05, :action_time=>0.000308, :before_filters_time=>1.6e-05}
4564
+ ~ Params: {"action"=>"template", "controller"=>"base"}
4565
+ ~ {:after_filters_time=>6.0e-06, :action_time=>0.000758, :before_filters_time=>5.0e-06}
4566
+ ~ Params: {"action"=>"template", "controller"=>"custom"}
4567
+ ~ {:after_filters_time=>1.1e-05, :action_time=>0.00073, :before_filters_time=>1.0e-05}
4568
+ ~ Starting Merb server listening at 0.0.0.0:4000
4569
+ ~ Params: {"action"=>"string", "controller"=>"base"}
4570
+ ~ {:after_filters_time=>1.4e-05, :action_time=>0.000232, :before_filters_time=>1.6e-05}
4571
+ ~ Params: {"action"=>"template", "controller"=>"base"}
4572
+ ~ {:after_filters_time=>5.0e-06, :action_time=>0.000701, :before_filters_time=>6.0e-06}
4573
+ ~ Params: {"action"=>"template", "controller"=>"custom"}
4574
+ ~ {:after_filters_time=>1.0e-05, :action_time=>0.000697, :before_filters_time=>1.0e-05}
4575
+ ~ Starting Merb server listening at 0.0.0.0:4000
4576
+ ~ Params: {"action"=>"string", "controller"=>"base"}
4577
+ ~ {:after_filters_time=>1.5e-05, :action_time=>0.000246, :before_filters_time=>1.6e-05}
4578
+ ~ Params: {"action"=>"template", "controller"=>"base"}
4579
+ ~ {:after_filters_time=>6.0e-06, :action_time=>0.000753, :before_filters_time=>5.0e-06}
4580
+ ~ Params: {"action"=>"template", "controller"=>"custom"}
4581
+ ~ {:after_filters_time=>1.3e-05, :action_time=>0.001565, :before_filters_time=>1.0e-05}
4582
+ ~ Starting Merb server listening at 0.0.0.0:4000
4583
+ ~ Params: {"action"=>"string", "controller"=>"base"}
4584
+ ~ {:after_filters_time=>1.5e-05, :action_time=>0.000236, :before_filters_time=>1.6e-05}
4585
+ ~ Params: {"action"=>"template", "controller"=>"base"}
4586
+ ~ {:after_filters_time=>6.0e-06, :action_time=>0.000735, :before_filters_time=>5.0e-06}
4587
+ ~ Params: {"action"=>"template", "controller"=>"custom"}
4588
+ ~ {:after_filters_time=>1.0e-05, :action_time=>0.000713, :before_filters_time=>9.0e-06}
@@ -288213,3 +288213,19 @@ Restarting Worker Thread
288213
288213
  ~ Starting Merb server listening at 0.0.0.0:4000
288214
288214
  ~ Starting Merb server listening at 0.0.0.0:4000
288215
288215
  ~ Starting Merb server listening at 0.0.0.0:4000
288216
+ ~ Starting Merb server listening at 0.0.0.0:4000
288217
+ ~ Starting Merb server listening at 0.0.0.0:4000
288218
+ ~ Starting Merb server listening at 0.0.0.0:4000
288219
+ ~ Starting Merb server listening at 0.0.0.0:4000
288220
+ ~ Starting Merb server listening at 0.0.0.0:4000
288221
+ ~ Starting Merb server listening at 0.0.0.0:4000
288222
+ ~ Starting Merb server listening at 0.0.0.0:4000
288223
+ ~ Starting Merb server listening at 0.0.0.0:4000
288224
+ ~ Starting Merb server listening at 0.0.0.0:4000
288225
+ ~ Starting Merb server listening at 0.0.0.0:4000
288226
+ ~ Starting Merb server listening at 0.0.0.0:4000
288227
+ ~ Starting Merb server listening at 0.0.0.0:4000
288228
+ ~ Starting Merb server listening at 0.0.0.0:4000
288229
+ ~ Starting Merb server listening at 0.0.0.0:4000
288230
+ ~ Starting Merb server listening at 0.0.0.0:4000
288231
+ ~ Starting Merb server listening at 0.0.0.0:4000
@@ -55,12 +55,25 @@ describe Merb::Request, " query and body params" do
55
55
 
56
56
  before(:all) { Merb::BootLoader::Dependencies.enable_json_gem }
57
57
 
58
- {"foo=bar&baz=bat" => {"foo" => "bar", "baz" => "bat"},
59
- "foo=bar&foo=baz" => {"foo" => "baz"},
60
- "foo[]=bar&foo[]=baz" => {"foo" => ["bar", "baz"]},
61
- "foo[][bar]=1&foo[][bar]=2" => {"foo" => [{"bar" => "1"},{"bar" => "2"}]},
62
- "foo[bar][][baz]=1&foo[bar][][baz]=2" => {"foo" => {"bar" => [{"baz" => "1"},{"baz" => "2"}]}},
63
- "foo[1]=bar&foo[2]=baz" => {"foo" => {"1" => "bar", "2" => "baz"}}}.each do |query, parse|
58
+ TEST_PARAMS = {
59
+ "foo=bar&baz=bat" => {"foo" => "bar", "baz" => "bat"},
60
+ "foo=bar&foo=baz" => {"foo" => "baz"},
61
+ "foo[]=bar&foo[]=baz" => {"foo" => ["bar", "baz"]},
62
+ "foo[][bar]=1&foo[][bar]=2" => {"foo" => [{"bar" => "1"},{"bar" => "2"}]},
63
+ "foo[bar][][baz]=1&foo[bar][][baz]=2" => {"foo" => {"bar" => [{"baz" => "1"},{"baz" => "2"}]}},
64
+ "foo[1]=bar&foo[2]=baz" => {"foo" => {"1" => "bar", "2" => "baz"}},
65
+
66
+ "foo[bar][baz]=1&foo[bar][zot]=2&foo[bar][zip]=3&foo[bar][buz]=4" => {"foo" => {"bar" => {"baz" => "1", "zot" => "2", "zip" => "3", "buz" => "4"}}},
67
+ "foo[bar][][baz]=1&foo[bar][][zot]=2&foo[bar][][zip]=3&foo[bar][][buz]=4" => {"foo" => {"bar" => [{"baz" => "1", "zot" => "2", "zip" => "3", "buz" => "4"}]}},
68
+ "foo[bar][][baz]=1&foo[bar][][zot]=2&foo[bar][][baz]=3&foo[bar][][zot]=4" => {"foo" => {"bar" => [{"baz" => "1", "zot" => "2"},{"baz" => "3", "zot" => "4"}]}},
69
+ "foo[bar][][baz]=1&foo[bar][][zot]=2&foo[bar][][fuz]=A&foo[bar][][baz]=3&foo[bar][][zot]=4&foo[bar][][fuz]=B" => {"foo" => {"bar" => [{"baz" => "1", "zot" => "2", "fuz" => "A"},{"baz" => "3", "zot" => "4", "fuz" => "B"}]}},
70
+ "foo[bar][][baz]=1&foo[bar][][zot]=2&foo[bar][][fuz]=A&foo[bar][][baz]=3&foo[bar][][zot]=4&foo[bar][][foz]=C" => {"foo" => {"bar" => [{"baz" => "1", "zot" => "2", "fuz" => "A"},{"baz" => "3", "zot" => "4", "foz" => "C"}]}},
71
+ "foo[bar][][baz]=1&foo[bar][][zot]=2&foo[bar][][fuz]=A&foo[bar][][baz]=3&foo[bar][][zot]=4" => {"foo" => {"bar" => [{"baz" => "1", "zot" => "2", "fuz" => "A"},{"baz" => "3", "zot" => "4"}]}},
72
+ "foo[bar][][baz]=1&foo[bar][][zot]=2&foo[bar][][fuz]=A&foo[bar][][baz]=3&foo[bar][][zot]=4&foo[bar][][fuz]=B&foo[bar][][foz]=C" => {"foo" => {"bar" => [{"baz" => "1", "zot" => "2", "fuz" => "A"},{"baz" => "3", "zot" => "4", "fuz" => "B", "foz" => "C"}]}},
73
+ "foo[][bar][][baz]=1&foo[][bar][][zot]=2&foo[][bar][][fuz]=A&foo[][bar][][baz]=3&foo[][bar][][zot]=4&foo[][bar][][fuz]=B&foo[][bar][][foz]=C" => {"foo" => {"bar" => [{"baz" => "1", "zot" => "2", "fuz" => "A"},{"baz" => "3", "zot" => "4", "fuz" => "B", "foz" => "C"}]}}
74
+ }
75
+
76
+ TEST_PARAMS.each do |query, parse|
64
77
 
65
78
  it "should convert #{query.inspect} to #{parse.inspect} in the query string" do
66
79
  request = fake_request({:query_string => query})
@@ -223,16 +236,12 @@ describe Merb::Request, " misc" do
223
236
 
224
237
  end
225
238
 
226
-
227
-
228
239
  describe Merb::Request, "#if_none_match" do
229
240
  it 'returns value of If-None-Match request header' do
230
241
  fake_request(Merb::Const::HTTP_IF_NONE_MATCH => "dc1562a133").if_none_match.should == "dc1562a133"
231
242
  end
232
243
  end
233
244
 
234
-
235
-
236
245
  describe Merb::Request, "#if_modified_since" do
237
246
  it 'returns value of If-Modified-Since request header' do
238
247
  t = '05 Sep 2008 22:00:27 GMT'
@@ -298,3 +298,227 @@ Fri, 05 Sep 2008 23:42:28 GMT ~ info ~ Logfile created
298
298
  ~ Starting Merb server listening at 0.0.0.0:4000
299
299
  ~ Starting Merb server listening at 0.0.0.0:4000
300
300
  ~ Starting Merb server listening at 0.0.0.0:4000
301
+ ~ Starting Merb server listening at 0.0.0.0:4000
302
+ ~ Starting Merb server listening at 0.0.0.0:4000
303
+ ~ Starting Merb server listening at 0.0.0.0:4000
304
+ ~ Started request handling: Tue Sep 09 13:13:14 +0300 2008
305
+ ~ Params: {"_session_id"=>"14b90737a309dc749fcc2b24e5cfe724", "action"=>"fixoid", "id"=>"tagging", "controller"=>"merb/test/fixtures/controllers/fixatable_routes"}
306
+ ~ Fixated session id: _session_id
307
+ ~ {:dispatch_time=>0.000506, :action_time=>0.000238, :after_filters_time=>1.1e-05, :before_filters_time=>1.3e-05}
308
+ ~ Starting Merb server listening at 0.0.0.0:4000
309
+ ~ Starting Merb server listening at 0.0.0.0:4000
310
+ ~ Starting Merb server listening at 0.0.0.0:4000
311
+ ~ Starting Merb server listening at 0.0.0.0:4000
312
+ ~ Starting Merb server listening at 0.0.0.0:4000
313
+ ~ Starting Merb server listening at 0.0.0.0:4000
314
+ ~ Starting Merb server listening at 0.0.0.0:4000
315
+ ~ Starting Merb server listening at 0.0.0.0:4000
316
+ ~ Starting Merb server listening at 0.0.0.0:4000
317
+ ~ Starting Merb server listening at 0.0.0.0:4000
318
+ ~ Started request handling: Tue Sep 09 23:12:28 +0300 2008
319
+ ~ Params: {"_session_id"=>"e896465cd59b45e3b599c543773919c9", "action"=>"fixoid", "id"=>"tagging", "controller"=>"merb/test/fixtures/controllers/fixatable_routes"}
320
+ ~ Fixated session id: _session_id
321
+ ~ {:dispatch_time=>0.000528, :action_time=>0.000245, :after_filters_time=>1.2e-05, :before_filters_time=>1.4e-05}
322
+ ~ Starting Merb server listening at 0.0.0.0:4000
323
+ ~ Starting Merb server listening at 0.0.0.0:4000
324
+ ~ Starting Merb server listening at 0.0.0.0:4000
325
+ ~ Starting Merb server listening at 0.0.0.0:4000
326
+ ~ Starting Merb server listening at 0.0.0.0:4000
327
+ ~ Starting Merb server listening at 0.0.0.0:4000
328
+ ~ Starting Merb server listening at 0.0.0.0:4000
329
+ ~ Starting Merb server listening at 0.0.0.0:4000
330
+ ~ Starting Merb server listening at 0.0.0.0:4000
331
+ ~ Starting Merb server listening at 0.0.0.0:4000
332
+ ~ Started request handling: Wed Sep 10 01:53:34 +0300 2008
333
+ ~ Params: {"_session_id"=>"00873219705ad4c9aea90b3cc3ff4d4b", "action"=>"fixoid", "id"=>"tagging", "controller"=>"merb/test/fixtures/controllers/fixatable_routes"}
334
+ ~ Fixated session id: _session_id
335
+ ~ {:dispatch_time=>0.000568, :action_time=>0.000248, :after_filters_time=>1.2e-05, :before_filters_time=>1.4e-05}
336
+ ~ Starting Merb server listening at 0.0.0.0:4000
337
+ ~ Starting Merb server listening at 0.0.0.0:4000
338
+ ~ Starting Merb server listening at 0.0.0.0:4000
339
+ ~ Starting Merb server listening at 0.0.0.0:4000
340
+ ~ Starting Merb server listening at 0.0.0.0:4000
341
+ ~ Starting Merb server listening at 0.0.0.0:4000
342
+ ~ Starting Merb server listening at 0.0.0.0:4000
343
+ ~ Starting Merb server listening at 0.0.0.0:4000
344
+ ~ Starting Merb server listening at 0.0.0.0:4000
345
+ ~ Starting Merb server listening at 0.0.0.0:4000
346
+ ~ Starting Merb server listening at 0.0.0.0:4000
347
+ ~ Started request handling: Wed Sep 10 03:11:24 +0300 2008
348
+ ~ Params: {"_session_id"=>"69eb3fd6b5c049ad72a6751e89840a5c", "action"=>"fixoid", "id"=>"tagging", "controller"=>"merb/test/fixtures/controllers/fixatable_routes"}
349
+ ~ Fixated session id: _session_id
350
+ ~ {:dispatch_time=>0.000583, :action_time=>0.000254, :after_filters_time=>1.5e-05, :before_filters_time=>1.8e-05}
351
+ ~ Starting Merb server listening at 0.0.0.0:4000
352
+ ~ Starting Merb server listening at 0.0.0.0:4000
353
+ ~ Starting Merb server listening at 0.0.0.0:4000
354
+ ~ Starting Merb server listening at 0.0.0.0:4000
355
+ ~ Starting Merb server listening at 0.0.0.0:4000
356
+ ~ Starting Merb server listening at 0.0.0.0:4000
357
+ ~ Starting Merb server listening at 0.0.0.0:4000
358
+ ~ Starting Merb server listening at 0.0.0.0:4000
359
+ ~ Starting Merb server listening at 0.0.0.0:4000
360
+ ~ Starting Merb server listening at 0.0.0.0:4000
361
+ ~ Started request handling: Wed Sep 10 03:15:06 +0300 2008
362
+ ~ Params: {"_session_id"=>"78bc84a1ffd3a83492397c8f26e4c935", "action"=>"fixoid", "id"=>"tagging", "controller"=>"merb/test/fixtures/controllers/fixatable_routes"}
363
+ ~ Fixated session id: _session_id
364
+ ~ {:dispatch_time=>0.000603, :action_time=>0.000333, :after_filters_time=>1.2e-05, :before_filters_time=>1.4e-05}
365
+ ~ Starting Merb server listening at 0.0.0.0:4000
366
+ ~ Starting Merb server listening at 0.0.0.0:4000
367
+ ~ Starting Merb server listening at 0.0.0.0:4000
368
+ ~ Starting Merb server listening at 0.0.0.0:4000
369
+ ~ Starting Merb server listening at 0.0.0.0:4000
370
+ ~ Starting Merb server listening at 0.0.0.0:4000
371
+ ~ Starting Merb server listening at 0.0.0.0:4000
372
+ ~ Starting Merb server listening at 0.0.0.0:4000
373
+ ~ Starting Merb server listening at 0.0.0.0:4000
374
+ ~ Starting Merb server listening at 0.0.0.0:4000
375
+ ~ Started request handling: Wed Sep 10 03:24:44 +0300 2008
376
+ ~ Params: {"_session_id"=>"3e7c9e3dfcc29a267e8eeacfc665fa23", "action"=>"fixoid", "id"=>"tagging", "controller"=>"merb/test/fixtures/controllers/fixatable_routes"}
377
+ ~ Fixated session id: _session_id
378
+ ~ {:dispatch_time=>0.000582, :action_time=>0.000313, :after_filters_time=>1.2e-05, :before_filters_time=>1.4e-05}
379
+ ~ Starting Merb server listening at 0.0.0.0:4000
380
+ ~ Starting Merb server listening at 0.0.0.0:4000
381
+ ~ Starting Merb server listening at 0.0.0.0:4000
382
+ ~ Starting Merb server listening at 0.0.0.0:4000
383
+ ~ Starting Merb server listening at 0.0.0.0:4000
384
+ ~ Starting Merb server listening at 0.0.0.0:4000
385
+ ~ Starting Merb server listening at 0.0.0.0:4000
386
+ ~ Starting Merb server listening at 0.0.0.0:4000
387
+ ~ Starting Merb server listening at 0.0.0.0:4000
388
+ ~ Started request handling: Wed Sep 10 04:26:45 +0300 2008
389
+ ~ Params: {"_session_id"=>"8cef7f3498371bf1e70f5583eacc9da8", "action"=>"fixoid", "id"=>"tagging", "controller"=>"merb/test/fixtures/controllers/fixatable_routes"}
390
+ ~ Fixated session id: _session_id
391
+ ~ {:dispatch_time=>0.000499, :action_time=>0.000234, :after_filters_time=>1.2e-05, :before_filters_time=>1.3e-05}
392
+ ~ Starting Merb server listening at 0.0.0.0:4000
393
+ ~ Starting Merb server listening at 0.0.0.0:4000
394
+ ~ Starting Merb server listening at 0.0.0.0:4000
395
+ ~ Starting Merb server listening at 0.0.0.0:4000
396
+ ~ Starting Merb server listening at 0.0.0.0:4000
397
+ ~ Starting Merb server listening at 0.0.0.0:4000
398
+ ~ Starting Merb server listening at 0.0.0.0:4000
399
+ ~ Starting Merb server listening at 0.0.0.0:4000
400
+ ~ Starting Merb server listening at 0.0.0.0:4000
401
+ ~ Starting Merb server listening at 0.0.0.0:4000
402
+ ~ Started request handling: Wed Sep 10 04:45:47 +0300 2008
403
+ ~ Params: {"_session_id"=>"fd4eca2181aae6ade8dfcef30dfad827", "action"=>"fixoid", "id"=>"tagging", "controller"=>"merb/test/fixtures/controllers/fixatable_routes"}
404
+ ~ Fixated session id: _session_id
405
+ ~ {:dispatch_time=>0.000571, :action_time=>0.000265, :after_filters_time=>1.2e-05, :before_filters_time=>1.5e-05}
406
+ ~ Starting Merb server listening at 0.0.0.0:4000
407
+ ~ Starting Merb server listening at 0.0.0.0:4000
408
+ ~ Starting Merb server listening at 0.0.0.0:4000
409
+ ~ Starting Merb server listening at 0.0.0.0:4000
410
+ ~ Starting Merb server listening at 0.0.0.0:4000
411
+ ~ Starting Merb server listening at 0.0.0.0:4000
412
+ ~ Starting Merb server listening at 0.0.0.0:4000
413
+ ~ Starting Merb server listening at 0.0.0.0:4000
414
+ ~ Starting Merb server listening at 0.0.0.0:4000
415
+ ~ Starting Merb server listening at 0.0.0.0:4000
416
+ ~ Starting Merb server listening at 0.0.0.0:4000
417
+ ~ Started request handling: Thu Sep 11 17:58:47 +0300 2008
418
+ ~ Params: {"_session_id"=>"f35c75cc7748c5b5ba88a59e5453dc73", "action"=>"fixoid", "id"=>"tagging", "controller"=>"merb/test/fixtures/controllers/fixatable_routes"}
419
+ ~ Fixated session id: _session_id
420
+ ~ {:dispatch_time=>0.000509, :action_time=>0.000237, :after_filters_time=>1.2e-05, :before_filters_time=>1.4e-05}
421
+ ~ Starting Merb server listening at 0.0.0.0:4000
422
+ ~ Starting Merb server listening at 0.0.0.0:4000
423
+ ~ Starting Merb server listening at 0.0.0.0:4000
424
+ ~ Starting Merb server listening at 0.0.0.0:4000
425
+ ~ Starting Merb server listening at 0.0.0.0:4000
426
+ ~ Starting Merb server listening at 0.0.0.0:4000
427
+ ~ Starting Merb server listening at 0.0.0.0:4000
428
+ ~ Starting Merb server listening at 0.0.0.0:4000
429
+ ~ Starting Merb server listening at 0.0.0.0:4000
430
+ ~ Started request handling: Sat Sep 13 03:30:03 +0300 2008
431
+ ~ Params: {"_session_id"=>"9776a870cee839d08fd2c9398e0bbf68", "action"=>"fixoid", "id"=>"tagging", "controller"=>"merb/test/fixtures/controllers/fixatable_routes"}
432
+ ~ Fixated session id: _session_id
433
+ ~ {:action_time=>0.000233, :after_filters_time=>1.2e-05, :before_filters_time=>1.4e-05, :dispatch_time=>0.000499}
434
+ ~ Starting Merb server listening at 0.0.0.0:4000
435
+ ~ Starting Merb server listening at 0.0.0.0:4000
436
+ ~ Starting Merb server listening at 0.0.0.0:4000
437
+ ~ Starting Merb server listening at 0.0.0.0:4000
438
+ ~ Starting Merb server listening at 0.0.0.0:4000
439
+ ~ Starting Merb server listening at 0.0.0.0:4000
440
+ ~ Starting Merb server listening at 0.0.0.0:4000
441
+ ~ Starting Merb server listening at 0.0.0.0:4000
442
+ ~ Starting Merb server listening at 0.0.0.0:4000
443
+ ~ Starting Merb server listening at 0.0.0.0:4000
444
+ ~ Starting Merb server listening at 0.0.0.0:4000
445
+ ~ Started request handling: Sat Sep 13 05:00:00 +0300 2008
446
+ ~ Params: {"_session_id"=>"e42e32d755f4eb48b793e34b81877995", "action"=>"fixoid", "id"=>"tagging", "controller"=>"merb/test/fixtures/controllers/fixatable_routes"}
447
+ ~ Fixated session id: _session_id
448
+ ~ {:action_time=>0.000236, :after_filters_time=>1.2e-05, :before_filters_time=>1.3e-05, :dispatch_time=>0.000557}
449
+ ~ Starting Merb server listening at 0.0.0.0:4000
450
+ ~ Starting Merb server listening at 0.0.0.0:4000
451
+ ~ Starting Merb server listening at 0.0.0.0:4000
452
+ ~ Starting Merb server listening at 0.0.0.0:4000
453
+ ~ Starting Merb server listening at 0.0.0.0:4000
454
+ ~ Starting Merb server listening at 0.0.0.0:4000
455
+ ~ Starting Merb server listening at 0.0.0.0:4000
456
+ ~ Starting Merb server listening at 0.0.0.0:4000
457
+ ~ Starting Merb server listening at 0.0.0.0:4000
458
+ ~ Starting Merb server listening at 0.0.0.0:4000
459
+ ~ Started request handling: Sat Sep 13 05:00:59 +0300 2008
460
+ ~ Params: {"_session_id"=>"a44c9aa38d7ee34c8358dfb564ebede0", "action"=>"fixoid", "id"=>"tagging", "controller"=>"merb/test/fixtures/controllers/fixatable_routes"}
461
+ ~ Fixated session id: _session_id
462
+ ~ {:action_time=>0.000233, :after_filters_time=>1.2e-05, :before_filters_time=>1.3e-05, :dispatch_time=>0.000503}
463
+ ~ Starting Merb server listening at 0.0.0.0:4000
464
+ ~ Starting Merb server listening at 0.0.0.0:4000
465
+ ~ Starting Merb server listening at 0.0.0.0:4000
466
+ ~ Starting Merb server listening at 0.0.0.0:4000
467
+ ~ Starting Merb server listening at 0.0.0.0:4000
468
+ ~ Starting Merb server listening at 0.0.0.0:4000
469
+ ~ Starting Merb server listening at 0.0.0.0:4000
470
+ ~ Starting Merb server listening at 0.0.0.0:4000
471
+ ~ Starting Merb server listening at 0.0.0.0:4000
472
+ ~ Started request handling: Sat Sep 13 18:50:57 +0300 2008
473
+ ~ Params: {"_session_id"=>"894c7df4c8a8dbd6f11d5c67ff0657a0", "action"=>"fixoid", "id"=>"tagging", "controller"=>"merb/test/fixtures/controllers/fixatable_routes"}
474
+ ~ Fixated session id: _session_id
475
+ ~ {:before_filters_time=>1.3e-05, :dispatch_time=>0.000507, :action_time=>0.000238, :after_filters_time=>1.2e-05}
476
+ ~ Starting Merb server listening at 0.0.0.0:4000
477
+ ~ Starting Merb server listening at 0.0.0.0:4000
478
+ ~ Starting Merb server listening at 0.0.0.0:4000
479
+ ~ Starting Merb server listening at 0.0.0.0:4000
480
+ ~ Starting Merb server listening at 0.0.0.0:4000
481
+ ~ Starting Merb server listening at 0.0.0.0:4000
482
+ ~ Starting Merb server listening at 0.0.0.0:4000
483
+ ~ Starting Merb server listening at 0.0.0.0:4000
484
+ ~ Starting Merb server listening at 0.0.0.0:4000
485
+ ~ Starting Merb server listening at 0.0.0.0:4000
486
+ ~ Started request handling: Sat Sep 13 18:52:22 +0300 2008
487
+ ~ Params: {"_session_id"=>"74b049032b318c06a65b740ae74bbc92", "action"=>"fixoid", "id"=>"tagging", "controller"=>"merb/test/fixtures/controllers/fixatable_routes"}
488
+ ~ Fixated session id: _session_id
489
+ ~ {:before_filters_time=>1.4e-05, :dispatch_time=>0.000607, :action_time=>0.000275, :after_filters_time=>1.3e-05}
490
+ ~ Starting Merb server listening at 0.0.0.0:4000
491
+ ~ Starting Merb server listening at 0.0.0.0:4000
492
+ ~ Starting Merb server listening at 0.0.0.0:4000
493
+ ~ Starting Merb server listening at 0.0.0.0:4000
494
+ ~ Starting Merb server listening at 0.0.0.0:4000
495
+ ~ Starting Merb server listening at 0.0.0.0:4000
496
+ ~ Starting Merb server listening at 0.0.0.0:4000
497
+ ~ Starting Merb server listening at 0.0.0.0:4000
498
+ ~ Starting Merb server listening at 0.0.0.0:4000
499
+ ~ Starting Merb server listening at 0.0.0.0:4000
500
+ ~ Started request handling: Sun Sep 14 00:12:59 +0300 2008
501
+ ~ Params: {"_session_id"=>"fc2fa500c8fa0caa1bbdf70908a728db", "action"=>"fixoid", "id"=>"tagging", "controller"=>"merb/test/fixtures/controllers/fixatable_routes"}
502
+ ~ Fixated session id: _session_id
503
+ ~ {:before_filters_time=>1.4e-05, :dispatch_time=>0.000576, :action_time=>0.00026, :after_filters_time=>1.3e-05}
504
+ ~ Starting Merb server listening at 0.0.0.0:4000
505
+ ~ Starting Merb server listening at 0.0.0.0:4000
506
+ ~ Starting Merb server listening at 0.0.0.0:4000
507
+ ~ Starting Merb server listening at 0.0.0.0:4000
508
+ ~ Starting Merb server listening at 0.0.0.0:4000
509
+ ~ Starting Merb server listening at 0.0.0.0:4000
510
+ ~ Starting Merb server listening at 0.0.0.0:4000
511
+ ~ Starting Merb server listening at 0.0.0.0:4000
512
+ ~ Starting Merb server listening at 0.0.0.0:4000
513
+ ~ Starting Merb server listening at 0.0.0.0:4000
514
+ ~ Started request handling: Sun Sep 14 00:52:47 +0300 2008
515
+ ~ Params: {"_session_id"=>"f2b8f9658efc2062bc38c6fe753f72b3", "action"=>"fixoid", "id"=>"tagging", "controller"=>"merb/test/fixtures/controllers/fixatable_routes"}
516
+ ~ Fixated session id: _session_id
517
+ ~ {:before_filters_time=>1.4e-05, :dispatch_time=>0.000577, :action_time=>0.000262, :after_filters_time=>1.3e-05}
518
+ ~ Starting Merb server listening at 0.0.0.0:4000
519
+ ~ Starting Merb server listening at 0.0.0.0:4000
520
+ ~ Starting Merb server listening at 0.0.0.0:4000
521
+ ~ Starting Merb server listening at 0.0.0.0:4000
522
+ ~ Starting Merb server listening at 0.0.0.0:4000
523
+ ~ Starting Merb server listening at 0.0.0.0:4000
524
+ ~ Starting Merb server listening at 0.0.0.0:4000