Skip to content

Commit 29eb5fc

Browse files
committed
Leave space after http method for Sinatra Actions
https://app.asana.com/0/348434637351502/512265208979249
1 parent cfa43ea commit 29eb5fc

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lib/appoptics/frameworks/sinatra.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def dispatch_with_appoptics
1818
# Report Controller/Action and transaction as best possible
1919
report_kvs = {}
2020
report_kvs[:Controller] = self.class
21-
report_kvs[:Action] = env['sinatra.route'].gsub(/ /, '') if env['sinatra.route']
21+
report_kvs[:Action] = env['sinatra.route']
2222
env['appoptics.controller'] = report_kvs[:Controller]
2323
env['appoptics.action'] = report_kvs[:Action]
2424

test/frameworks/sinatra_test.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454

5555
r.body.must_match /123304952309747203947/
5656

57-
assert_equal "SinatraSimple.GET/render/:id", test_action
57+
assert_equal "SinatraSimple.GET /render/:id", test_action
5858
assert_equal "http://example.org/render/123304952309747203947", test_url
5959
assert_equal 200, test_status
6060
assert_equal "GET", test_method
@@ -78,7 +78,7 @@
7878

7979
r.body.must_match /WOOT.*123304952309747203947/
8080

81-
assert_equal "SinatraSimple.GET/render/:id/what", test_action
81+
assert_equal "SinatraSimple.GET /render/:id/what", test_action
8282
assert_equal "http://example.org/render/123304952309747203947/what", test_url
8383
assert_equal 200, test_status
8484
assert_equal "GET", test_method
@@ -102,7 +102,7 @@
102102

103103
r.body.must_match /hello world/
104104

105-
assert_equal "SinatraSimple.GET/say/*/to/*", test_action
105+
assert_equal "SinatraSimple.GET /say/*/to/*", test_action
106106
assert_equal "http://example.org/say/hello/to/world", test_url
107107
assert_equal 200, test_status
108108
assert_equal "GET", test_method
@@ -127,7 +127,7 @@
127127

128128
r.body.must_match /Hello, friend/
129129

130-
test_action.must_match "SinatraSimple.GET\\/hello\\/([\\w]+)", test_action
130+
test_action.must_match "SinatraSimple.GET \\/hello\\/([\\w]+)", test_action
131131
assert_equal "http://example.org/hello/friend", test_url
132132
assert_equal 200, test_status
133133
assert_equal "GET", test_method

0 commit comments

Comments
 (0)