aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/journey/route_test.rb
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2016-08-06 19:44:11 +0200
committerXavier Noria <fxn@hashref.com>2016-08-06 19:44:11 +0200
commit411ccbdab2608c62aabdb320d52cb02d446bb39c (patch)
tree05671553ac2a23dd1db4d11949c1ac43c3dd1367 /actionpack/test/journey/route_test.rb
parent60b67d76dc1d98e4269aac7705e9d8323eb42942 (diff)
downloadrails-411ccbdab2608c62aabdb320d52cb02d446bb39c.tar.gz
rails-411ccbdab2608c62aabdb320d52cb02d446bb39c.tar.bz2
rails-411ccbdab2608c62aabdb320d52cb02d446bb39c.zip
remove redundant curlies from hash arguments
Diffstat (limited to 'actionpack/test/journey/route_test.rb')
-rw-r--r--actionpack/test/journey/route_test.rb32
1 files changed, 14 insertions, 18 deletions
diff --git a/actionpack/test/journey/route_test.rb b/actionpack/test/journey/route_test.rb
index 5364f9de81..cce5c2ae37 100644
--- a/actionpack/test/journey/route_test.rb
+++ b/actionpack/test/journey/route_test.rb
@@ -35,57 +35,53 @@ module ActionDispatch
def test_ip_address
path = Path::Pattern.from_string "/messages/:id(.:format)"
route = Route.build("name", nil, path, {ip: "192.168.1.1"}, [],
- { controller: "foo", action: "bar" })
+ controller: "foo", action: "bar")
assert_equal "192.168.1.1", route.ip
end
def test_default_ip
path = Path::Pattern.from_string "/messages/:id(.:format)"
route = Route.build("name", nil, path, {}, [],
- { controller: "foo", action: "bar" })
+ controller: "foo", action: "bar")
assert_equal(//, route.ip)
end
def test_format_with_star
path = Path::Pattern.from_string "/:controller/*extra"
route = Route.build("name", nil, path, {}, [],
- { controller: "foo", action: "bar" })
- assert_equal "/foo/himom", route.format({
- controller: "foo",
- extra: "himom",
- })
+ controller: "foo", action: "bar")
+ assert_equal "/foo/himom", route.format( controller: "foo",
+ extra: "himom")
end
def test_connects_all_match
path = Path::Pattern.from_string "/:controller(/:action(/:id(.:format)))"
- route = Route.build("name", nil, path, {action: "bar"}, [], { controller: "foo" })
+ route = Route.build("name", nil, path, {action: "bar"}, [], controller: "foo")
- assert_equal "/foo/bar/10", route.format({
- controller: "foo",
+ assert_equal "/foo/bar/10", route.format( controller: "foo",
action: "bar",
- id: 10
- })
+ id: 10)
end
def test_extras_are_not_included_if_optional
path = Path::Pattern.from_string "/page/:id(/:action)"
- route = Route.build("name", nil, path, { }, [], { action: "show" })
+ route = Route.build("name", nil, path, { }, [], action: "show")
- assert_equal "/page/10", route.format({ id: 10 })
+ assert_equal "/page/10", route.format(id: 10)
end
def test_extras_are_not_included_if_optional_with_parameter
path = Path::Pattern.from_string "(/sections/:section)/pages/:id"
- route = Route.build("name", nil, path, { }, [], { action: "show" })
+ route = Route.build("name", nil, path, { }, [], action: "show")
- assert_equal "/pages/10", route.format({id: 10})
+ assert_equal "/pages/10", route.format(id: 10)
end
def test_extras_are_not_included_if_optional_parameter_is_nil
path = Path::Pattern.from_string "(/sections/:section)/pages/:id"
- route = Route.build("name", nil, path, { }, [], { action: "show" })
+ route = Route.build("name", nil, path, { }, [], action: "show")
- assert_equal "/pages/10", route.format({id: 10, section: nil})
+ assert_equal "/pages/10", route.format(id: 10, section: nil)
end
def test_score