Permalink
Browse files

Use $VegGuide::REST_VERSION var in tests instead of hard coding api v…

…ersion
  • Loading branch information...
1 parent e7603dd commit 32070b1fc2df70a8af6c7ecdf8f323ed2945f881 @autarch autarch committed Oct 6, 2012
Showing with 30 additions and 17 deletions.
  1. +16 −8 t/rest-api/Entry.t
  2. +6 −3 t/rest-api/Region.t
  3. +3 −2 t/rest-api/Root.t
  4. +3 −3 t/rest-api/Search.t
  5. +2 −1 t/rest-api/User.t
View
@@ -16,7 +16,8 @@ use_test_database();
is(
$response->header('Content-Type'),
- 'application/vnd.vegguide.org-entry+json; charset=UTF-8; version=0.0.1',
+ 'application/vnd.vegguide.org-entry+json; charset=UTF-8; version='
+ . $VegGuide::REST_VERSION,
'got the right RESTful content type'
);
@@ -92,7 +93,8 @@ use_test_database();
is(
$response->header('Content-Type'),
- 'application/vnd.vegguide.org-entry-reviews+json; charset=UTF-8; version=0.0.1',
+ 'application/vnd.vegguide.org-entry-reviews+json; charset=UTF-8; version='
+ . $VegGuide::REST_VERSION,
'got the right RESTful content type'
);
@@ -180,7 +182,8 @@ use_test_database();
is(
$response->header('Content-Type'),
- 'application/vnd.vegguide.org-entry-images+json; charset=UTF-8; version=0.0.1',
+ 'application/vnd.vegguide.org-entry-images+json; charset=UTF-8; version='
+ . $VegGuide::REST_VERSION,
'got the right RESTful content type'
);
@@ -329,7 +332,8 @@ use_test_database();
is(
$response->header('Content-Type'),
- 'application/vnd.vegguide.org-entry+json; charset=UTF-8; version=0.0.1',
+ 'application/vnd.vegguide.org-entry+json; charset=UTF-8; version='
+ . $VegGuide::REST_VERSION,
'got the right RESTful content type'
);
@@ -357,7 +361,8 @@ use_test_database();
is(
$response->header('Content-Type'),
- 'application/vnd.vegguide.org-entry+json; charset=UTF-8; version=0.0.1',
+ 'application/vnd.vegguide.org-entry+json; charset=UTF-8; version='
+ . $VegGuide::REST_VERSION,
'got the right RESTful content type'
);
@@ -377,7 +382,8 @@ use_test_database();
is(
$response->header('Content-Type'),
- 'application/vnd.vegguide.org-entry+json; charset=UTF-8; version=0.0.1',
+ 'application/vnd.vegguide.org-entry+json; charset=UTF-8; version='
+ . $VegGuide::REST_VERSION,
'got the right RESTful content type'
);
@@ -402,7 +408,8 @@ use_test_database();
is(
$response->header('Content-Type'),
- 'application/vnd.vegguide.org-entry+json; charset=UTF-8; version=0.0.1',
+ 'application/vnd.vegguide.org-entry+json; charset=UTF-8; version='
+ . $VegGuide::REST_VERSION,
'got the right RESTful content type'
);
@@ -430,7 +437,8 @@ use_test_database();
is(
$response->header('Content-Type'),
- 'application/vnd.vegguide.org-entry+json; charset=UTF-8; version=0.0.1',
+ 'application/vnd.vegguide.org-entry+json; charset=UTF-8; version='
+ . $VegGuide::REST_VERSION,
'got the right RESTful content type'
);
View
@@ -16,7 +16,8 @@ use_test_database();
is(
$response->header('Content-Type'),
- 'application/vnd.vegguide.org-region+json; charset=UTF-8; version=0.0.1',
+ 'application/vnd.vegguide.org-region+json; charset=UTF-8; version='
+ . $VegGuide::REST_VERSION,
'got the right RESTful content type'
);
@@ -154,7 +155,8 @@ use_test_database();
is(
$response->header('Content-Type'),
- 'application/vnd.vegguide.org-entries+json; charset=UTF-8; version=0.0.1',
+ 'application/vnd.vegguide.org-entries+json; charset=UTF-8; version='
+ . $VegGuide::REST_VERSION,
'got the right RESTful content type'
);
@@ -180,7 +182,8 @@ use_test_database();
is(
$response->header('Content-Type'),
- 'application/vnd.vegguide.org-entries+json; charset=UTF-8; version=0.0.1',
+ 'application/vnd.vegguide.org-entries+json; charset=UTF-8; version='
+ . $VegGuide::REST_VERSION,
'got the right RESTful content type'
);
View
@@ -17,7 +17,8 @@ use_test_database();
is(
$response->header('Content-Type'),
- 'application/vnd.vegguide.org-root-regions+json; charset=UTF-8; version=0.0.1',
+ 'application/vnd.vegguide.org-root-regions+json; charset=UTF-8; version='
+ . $VegGuide::REST_VERSION,
'got the right RESTful content type'
);
@@ -27,7 +28,7 @@ use_test_database();
for qw( primary secondary );
my $na = first { $_->{name} eq 'North America' }
- @{ $regions->{regions}{primary} };
+ @{ $regions->{regions}{primary} };
my $children = delete $na->{children};
ok(
View
@@ -22,7 +22,7 @@ use_test_database();
is(
$response->header('Content-Type'),
- 'application/vnd.vegguide.org-search+json; charset=UTF-8; version=0.0.1',
+ 'application/vnd.vegguide.org-search+json; charset=UTF-8; version=' . $VegGuide::REST_VERSION,
'got the right RESTful content type'
);
@@ -89,7 +89,7 @@ use_test_database();
is(
$response->header('Content-Type'),
- 'application/vnd.vegguide.org-search+json; charset=UTF-8; version=0.0.1',
+ 'application/vnd.vegguide.org-search+json; charset=UTF-8; version=' . $VegGuide::REST_VERSION,
'got the right RESTful content type'
);
@@ -125,7 +125,7 @@ use_test_database();
is(
$response->header('Content-Type'),
- 'application/vnd.vegguide.org-search+json; charset=UTF-8; version=0.0.1',
+ 'application/vnd.vegguide.org-search+json; charset=UTF-8; version=' . $VegGuide::REST_VERSION,
'got the right RESTful content type'
);
View
@@ -16,7 +16,8 @@ use_test_database();
is(
$response->header('Content-Type'),
- 'application/vnd.vegguide.org-user+json; charset=UTF-8; version=0.0.1',
+ 'application/vnd.vegguide.org-user+json; charset=UTF-8; version='
+ . $VegGuide::REST_VERSION,
'got the right RESTful content type'
);

0 comments on commit 32070b1

Please sign in to comment.