ruby_odata 0.1.6 → 0.2.0.beta1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +2 -0
- data/CHANGELOG.md +5 -0
- data/Gemfile +2 -0
- data/Guardfile +1 -1
- data/features/basic_auth.feature +13 -13
- data/features/cassettes/basic_auth_protected_resource.yml +22 -20
- data/features/cassettes/batch_request_additions.yml +26 -26
- data/features/cassettes/batch_request_deletes.yml +27 -27
- data/features/cassettes/batch_request_updates.yml +26 -26
- data/features/cassettes/clean_database_for_testing.yml +10 -10
- data/features/cassettes/cucumber_tags/basic_auth.yml +54 -163
- data/features/cassettes/cucumber_tags/batch_request.yml +229 -1118
- data/features/cassettes/cucumber_tags/complex_types.yml +81 -191
- data/features/cassettes/cucumber_tags/error_handling.yml +45 -33
- data/features/cassettes/cucumber_tags/query_builder.yml +555 -1248
- data/features/cassettes/cucumber_tags/service_manage.yml +216 -591
- data/features/cassettes/cucumber_tags/service_methods.yml +137 -412
- data/features/cassettes/cucumber_tags/ssl.yml +121 -117
- data/features/cassettes/cucumber_tags/type_conversion.yml +104 -170
- data/features/cassettes/service_manage_additions.yml +26 -28
- data/features/cassettes/service_manage_deletions.yml +21 -21
- data/features/cassettes/service_manage_deletions_2.yml +21 -21
- data/features/cassettes/unsecured_metadata.yml +14 -14
- data/features/service.feature +37 -37
- data/features/service_methods.feature +38 -38
- data/features/step_definitions/pickle_steps.rb +5 -5
- data/features/step_definitions/service_steps.rb +26 -26
- data/features/support/hooks.rb +3 -2
- data/features/support/vcr.rb +13 -13
- data/lib/ruby_odata.rb +4 -1
- data/lib/ruby_odata/association.rb +15 -8
- data/lib/ruby_odata/class_builder.rb +5 -1
- data/lib/ruby_odata/query_builder.rb +171 -173
- data/lib/ruby_odata/resource.rb +153 -0
- data/lib/ruby_odata/service.rb +30 -30
- data/lib/ruby_odata/version.rb +1 -1
- data/ruby_odata.gemspec +48 -43
- data/spec/association_spec.rb +15 -11
- data/spec/fixtures/decimal/metadata.xml +1 -0
- data/spec/fixtures/v4/edmx_metadata.xml +145 -0
- data/spec/fixtures/v4/result_categories.xml +0 -0
- data/spec/revised_service_spec.rb +16 -11
- data/spec/service_spec.rb +149 -114
- data/spec/service_v4_spec.rb +102 -0
- data/spec/spec_helper.rb +6 -1
- metadata +109 -32
- data/features/cassettes/cucumber_tags/service.yml +0 -234
@@ -2,39 +2,37 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: post
|
5
|
-
uri: http://
|
5
|
+
uri: http://10.10.0.17:8989/SampleService/RubyOData.svc/Products
|
6
6
|
body:
|
7
|
-
encoding:
|
8
|
-
string:
|
9
|
-
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"Name":"Sample Product","Description":"Test Widget","Price":"75.50","Category":{"Name":"Category
|
9
|
+
0059","AuditFields":{"CreatedBy":"Machinist"}},"AuditFields":{"CreatedBy":"Machinist"}}'
|
10
10
|
headers:
|
11
|
+
User-Agent:
|
12
|
+
- Ruby
|
11
13
|
Accept:
|
12
|
-
-
|
13
|
-
Accept-Encoding:
|
14
|
-
- gzip, deflate
|
14
|
+
- "*/*; q=0.5, application/xml"
|
15
15
|
Content-Type:
|
16
16
|
- application/json
|
17
|
-
|
18
|
-
-
|
19
|
-
User-Agent:
|
20
|
-
- Ruby
|
17
|
+
Accept-Encoding:
|
18
|
+
- gzip,deflate
|
21
19
|
response:
|
22
20
|
status:
|
23
21
|
code: 201
|
24
|
-
message:
|
22
|
+
message: ''
|
25
23
|
headers:
|
26
24
|
Cache-Control:
|
27
|
-
-
|
25
|
+
- private
|
28
26
|
Content-Length:
|
29
|
-
- '
|
27
|
+
- '1447'
|
30
28
|
Content-Type:
|
31
29
|
- application/atom+xml;type=entry;charset=utf-8
|
32
30
|
Location:
|
33
|
-
- http://
|
31
|
+
- http://10.10.0.17:8989/SampleService/RubyOData.svc/Products(1)
|
34
32
|
Server:
|
35
|
-
- Microsoft-IIS/
|
33
|
+
- Microsoft-IIS/8.0
|
36
34
|
Set-Cookie:
|
37
|
-
- ASP.NET_SessionId=
|
35
|
+
- ASP.NET_SessionId=yi20lwcen2khadra1on4ncpm; path=/; HttpOnly
|
38
36
|
X-Content-Type-Options:
|
39
37
|
- nosniff
|
40
38
|
Dataserviceversion:
|
@@ -44,22 +42,22 @@ http_interactions:
|
|
44
42
|
X-Powered-By:
|
45
43
|
- ASP.NET
|
46
44
|
Date:
|
47
|
-
-
|
45
|
+
- Sun, 26 Apr 2015 16:29:49 GMT
|
48
46
|
body:
|
49
|
-
encoding:
|
50
|
-
string: <?xml version="1.0" encoding="utf-8"?><entry xml:base="http://
|
47
|
+
encoding: UTF-8
|
48
|
+
string: <?xml version="1.0" encoding="utf-8"?><entry xml:base="http://10.10.0.17:8989/SampleService/RubyOData.svc/"
|
51
49
|
xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices"
|
52
50
|
xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:georss="http://www.georss.org/georss"
|
53
|
-
xmlns:gml="http://www.opengis.net/gml"><id>http://
|
51
|
+
xmlns:gml="http://www.opengis.net/gml"><id>http://10.10.0.17:8989/SampleService/RubyOData.svc/Products(1)</id><category
|
54
52
|
term="RubyODataService.Product" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"
|
55
53
|
/><link rel="edit" title="Product" href="Products(1)" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Category"
|
56
54
|
type="application/atom+xml;type=entry" title="Category" href="Products(1)/Category"
|
57
|
-
/><title /><updated>
|
55
|
+
/><title /><updated>2015-04-26T16:29:50Z</updated><author><name /></author><content
|
58
56
|
type="application/xml"><m:properties><d:Id m:type="Edm.Int32">1</d:Id><d:Name>Sample
|
59
|
-
Product</d:Name><d:Description>Test Widget</d:Description><d:Price m:type="Edm.Decimal">
|
57
|
+
Product</d:Name><d:Description>Test Widget</d:Description><d:Price m:type="Edm.Decimal">75.50</d:Price><d:DiscontinuedDate
|
60
58
|
m:type="Edm.DateTime" m:null="true" /><d:CategoryId m:type="Edm.Int32">1</d:CategoryId><d:AuditFields
|
61
|
-
m:type="RubyODataService.AuditFields"><d:CreateDate m:type="Edm.DateTime">
|
62
|
-
m:type="Edm.DateTime">
|
63
|
-
http_version:
|
64
|
-
recorded_at:
|
65
|
-
recorded_with: VCR 2.
|
59
|
+
m:type="RubyODataService.AuditFields"><d:CreateDate m:type="Edm.DateTime">2015-04-26T16:29:49.786157Z</d:CreateDate><d:ModifiedDate
|
60
|
+
m:type="Edm.DateTime">2015-04-26T16:29:49.786157Z</d:ModifiedDate><d:CreatedBy>Machinist</d:CreatedBy></d:AuditFields></m:properties></content></entry>
|
61
|
+
http_version:
|
62
|
+
recorded_at: Sun, 26 Apr 2015 16:29:50 GMT
|
63
|
+
recorded_with: VCR 2.5.0
|
@@ -2,32 +2,32 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: http://
|
5
|
+
uri: http://10.10.0.17:8989/SampleService/RubyOData.svc/Products(1)
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
9
9
|
headers:
|
10
|
-
Accept:
|
11
|
-
- ! '*/*; q=0.5, application/xml'
|
12
|
-
Accept-Encoding:
|
13
|
-
- gzip, deflate
|
14
10
|
User-Agent:
|
15
11
|
- Ruby
|
12
|
+
Accept:
|
13
|
+
- "*/*; q=0.5, application/xml"
|
14
|
+
Accept-Encoding:
|
15
|
+
- gzip,deflate
|
16
16
|
response:
|
17
17
|
status:
|
18
18
|
code: 200
|
19
|
-
message:
|
19
|
+
message: ''
|
20
20
|
headers:
|
21
21
|
Cache-Control:
|
22
|
-
-
|
22
|
+
- private
|
23
23
|
Content-Length:
|
24
|
-
- '
|
24
|
+
- '1437'
|
25
25
|
Content-Type:
|
26
26
|
- application/atom+xml;type=entry;charset=utf-8
|
27
27
|
Server:
|
28
|
-
- Microsoft-IIS/
|
28
|
+
- Microsoft-IIS/8.0
|
29
29
|
Set-Cookie:
|
30
|
-
- ASP.NET_SessionId=
|
30
|
+
- ASP.NET_SessionId=pizgaagzomtggnagi5xlmbmv; path=/; HttpOnly
|
31
31
|
X-Content-Type-Options:
|
32
32
|
- nosniff
|
33
33
|
Dataserviceversion:
|
@@ -37,22 +37,22 @@ http_interactions:
|
|
37
37
|
X-Powered-By:
|
38
38
|
- ASP.NET
|
39
39
|
Date:
|
40
|
-
-
|
40
|
+
- Sun, 26 Apr 2015 16:29:50 GMT
|
41
41
|
body:
|
42
|
-
encoding:
|
43
|
-
string: <?xml version="1.0" encoding="utf-8"?><entry xml:base="http://
|
42
|
+
encoding: UTF-8
|
43
|
+
string: <?xml version="1.0" encoding="utf-8"?><entry xml:base="http://10.10.0.17:8989/SampleService/RubyOData.svc/"
|
44
44
|
xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices"
|
45
45
|
xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:georss="http://www.georss.org/georss"
|
46
|
-
xmlns:gml="http://www.opengis.net/gml"><id>http://
|
46
|
+
xmlns:gml="http://www.opengis.net/gml"><id>http://10.10.0.17:8989/SampleService/RubyOData.svc/Products(1)</id><category
|
47
47
|
term="RubyODataService.Product" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"
|
48
48
|
/><link rel="edit" title="Product" href="Products(1)" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Category"
|
49
49
|
type="application/atom+xml;type=entry" title="Category" href="Products(1)/Category"
|
50
|
-
/><title /><updated>
|
50
|
+
/><title /><updated>2015-04-26T16:29:51Z</updated><author><name /></author><content
|
51
51
|
type="application/xml"><m:properties><d:Id m:type="Edm.Int32">1</d:Id><d:Name>Test
|
52
|
-
Product</d:Name><d:Description>Test Widget</d:Description><d:Price m:type="Edm.Decimal">
|
52
|
+
Product</d:Name><d:Description>Test Widget</d:Description><d:Price m:type="Edm.Decimal">25.00</d:Price><d:DiscontinuedDate
|
53
53
|
m:type="Edm.DateTime" m:null="true" /><d:CategoryId m:type="Edm.Int32">1</d:CategoryId><d:AuditFields
|
54
|
-
m:type="RubyODataService.AuditFields"><d:CreateDate m:type="Edm.DateTime">
|
55
|
-
m:type="Edm.DateTime">
|
56
|
-
http_version:
|
57
|
-
recorded_at:
|
58
|
-
recorded_with: VCR 2.
|
54
|
+
m:type="RubyODataService.AuditFields"><d:CreateDate m:type="Edm.DateTime">2015-04-26T16:29:51.287</d:CreateDate><d:ModifiedDate
|
55
|
+
m:type="Edm.DateTime">2015-04-26T16:29:51.287</d:ModifiedDate><d:CreatedBy>Machinist</d:CreatedBy></d:AuditFields></m:properties></content></entry>
|
56
|
+
http_version:
|
57
|
+
recorded_at: Sun, 26 Apr 2015 16:29:51 GMT
|
58
|
+
recorded_with: VCR 2.5.0
|
@@ -2,32 +2,32 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: http://
|
5
|
+
uri: http://10.10.0.17:8989/SampleService/RubyOData.svc/Products(1)
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
9
9
|
headers:
|
10
|
-
Accept:
|
11
|
-
- ! '*/*; q=0.5, application/xml'
|
12
|
-
Accept-Encoding:
|
13
|
-
- gzip, deflate
|
14
10
|
User-Agent:
|
15
11
|
- Ruby
|
12
|
+
Accept:
|
13
|
+
- "*/*; q=0.5, application/xml"
|
14
|
+
Accept-Encoding:
|
15
|
+
- gzip,deflate
|
16
16
|
response:
|
17
17
|
status:
|
18
18
|
code: 200
|
19
|
-
message:
|
19
|
+
message: ''
|
20
20
|
headers:
|
21
21
|
Cache-Control:
|
22
|
-
-
|
22
|
+
- private
|
23
23
|
Content-Length:
|
24
|
-
- '
|
24
|
+
- '1445'
|
25
25
|
Content-Type:
|
26
26
|
- application/atom+xml;type=entry;charset=utf-8
|
27
27
|
Server:
|
28
|
-
- Microsoft-IIS/
|
28
|
+
- Microsoft-IIS/8.0
|
29
29
|
Set-Cookie:
|
30
|
-
- ASP.NET_SessionId=
|
30
|
+
- ASP.NET_SessionId=pjn1eic4di3f3u3vdpispb55; path=/; HttpOnly
|
31
31
|
X-Content-Type-Options:
|
32
32
|
- nosniff
|
33
33
|
Dataserviceversion:
|
@@ -37,22 +37,22 @@ http_interactions:
|
|
37
37
|
X-Powered-By:
|
38
38
|
- ASP.NET
|
39
39
|
Date:
|
40
|
-
-
|
40
|
+
- Sun, 26 Apr 2015 16:29:51 GMT
|
41
41
|
body:
|
42
|
-
encoding:
|
43
|
-
string: <?xml version="1.0" encoding="utf-8"?><entry xml:base="http://
|
42
|
+
encoding: UTF-8
|
43
|
+
string: <?xml version="1.0" encoding="utf-8"?><entry xml:base="http://10.10.0.17:8989/SampleService/RubyOData.svc/"
|
44
44
|
xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices"
|
45
45
|
xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:georss="http://www.georss.org/georss"
|
46
|
-
xmlns:gml="http://www.opengis.net/gml"><id>http://
|
46
|
+
xmlns:gml="http://www.opengis.net/gml"><id>http://10.10.0.17:8989/SampleService/RubyOData.svc/Products(1)</id><category
|
47
47
|
term="RubyODataService.Product" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"
|
48
48
|
/><link rel="edit" title="Product" href="Products(1)" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Category"
|
49
49
|
type="application/atom+xml;type=entry" title="Category" href="Products(1)/Category"
|
50
|
-
/><title /><updated>
|
50
|
+
/><title /><updated>2015-04-26T16:29:51Z</updated><author><name /></author><content
|
51
51
|
type="application/xml"><m:properties><d:Id m:type="Edm.Int32">1</d:Id><d:Name>Changed
|
52
|
-
Test Product</d:Name><d:Description>Test Widget</d:Description><d:Price m:type="Edm.Decimal">
|
52
|
+
Test Product</d:Name><d:Description>Test Widget</d:Description><d:Price m:type="Edm.Decimal">25.00</d:Price><d:DiscontinuedDate
|
53
53
|
m:type="Edm.DateTime" m:null="true" /><d:CategoryId m:type="Edm.Int32">1</d:CategoryId><d:AuditFields
|
54
|
-
m:type="RubyODataService.AuditFields"><d:CreateDate m:type="Edm.DateTime">
|
55
|
-
m:type="Edm.DateTime">
|
56
|
-
http_version:
|
57
|
-
recorded_at:
|
58
|
-
recorded_with: VCR 2.
|
54
|
+
m:type="RubyODataService.AuditFields"><d:CreateDate m:type="Edm.DateTime">2015-04-26T16:29:51.287</d:CreateDate><d:ModifiedDate
|
55
|
+
m:type="Edm.DateTime">2015-04-26T16:29:51.287</d:ModifiedDate><d:CreatedBy>Machinist</d:CreatedBy></d:AuditFields></m:properties></content></entry>
|
56
|
+
http_version:
|
57
|
+
recorded_at: Sun, 26 Apr 2015 16:29:51 GMT
|
58
|
+
recorded_with: VCR 2.5.0
|
@@ -2,32 +2,32 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: http://
|
5
|
+
uri: http://10.10.0.17:8989/SampleService/RubyOData.svc/$metadata
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
9
9
|
headers:
|
10
|
-
Accept:
|
11
|
-
- ! '*/*; q=0.5, application/xml'
|
12
|
-
Accept-Encoding:
|
13
|
-
- gzip, deflate
|
14
10
|
User-Agent:
|
15
11
|
- Ruby
|
12
|
+
Accept:
|
13
|
+
- "*/*; q=0.5, application/xml"
|
14
|
+
Accept-Encoding:
|
15
|
+
- gzip,deflate
|
16
16
|
response:
|
17
17
|
status:
|
18
18
|
code: 200
|
19
|
-
message:
|
19
|
+
message: ''
|
20
20
|
headers:
|
21
21
|
Cache-Control:
|
22
|
-
-
|
22
|
+
- private
|
23
23
|
Content-Length:
|
24
24
|
- '4055'
|
25
25
|
Content-Type:
|
26
26
|
- application/xml;charset=utf-8
|
27
27
|
Server:
|
28
|
-
- Microsoft-IIS/
|
28
|
+
- Microsoft-IIS/8.0
|
29
29
|
Set-Cookie:
|
30
|
-
- ASP.NET_SessionId=
|
30
|
+
- ASP.NET_SessionId=q4q3bi2ftgf1n4xdsw3weviz; path=/; HttpOnly
|
31
31
|
X-Content-Type-Options:
|
32
32
|
- nosniff
|
33
33
|
Dataserviceversion:
|
@@ -37,9 +37,9 @@ http_interactions:
|
|
37
37
|
X-Powered-By:
|
38
38
|
- ASP.NET
|
39
39
|
Date:
|
40
|
-
-
|
40
|
+
- Sun, 26 Apr 2015 16:30:01 GMT
|
41
41
|
body:
|
42
|
-
encoding:
|
42
|
+
encoding: UTF-8
|
43
43
|
string: <?xml version="1.0" encoding="utf-8"?><edmx:Edmx Version="1.0" xmlns:edmx="http://schemas.microsoft.com/ado/2007/06/edmx"><edmx:DataServices
|
44
44
|
m:DataServiceVersion="1.0" m:MaxDataServiceVersion="3.0" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"><Schema
|
45
45
|
Namespace="RubyODataService" xmlns="http://schemas.microsoft.com/ado/2008/09/edm"><EntityType
|
@@ -84,6 +84,6 @@ http_interactions:
|
|
84
84
|
ReturnType="Edm.Int32" m:HttpMethod="GET" /><FunctionImport Name="EntitySingleCategoryWebGet"
|
85
85
|
ReturnType="RubyODataService.Category" EntitySet="Categories" m:HttpMethod="GET"><Parameter
|
86
86
|
Name="id" Type="Edm.Int32" /></FunctionImport></EntityContainer></Schema></edmx:DataServices></edmx:Edmx>
|
87
|
-
http_version:
|
88
|
-
recorded_at:
|
89
|
-
recorded_with: VCR 2.
|
87
|
+
http_version:
|
88
|
+
recorded_at: Sun, 26 Apr 2015 16:30:02 GMT
|
89
|
+
recorded_with: VCR 2.5.0
|
data/features/service.feature
CHANGED
@@ -11,40 +11,40 @@ Background:
|
|
11
11
|
Scenario: Service should respond to valid collections
|
12
12
|
Then I should be able to call "Categories" on the service
|
13
13
|
|
14
|
-
Scenario: Service should not respond to an invalid collection
|
15
|
-
|
16
|
-
|
17
|
-
Scenario: Service should respond to accessing a single entity by ID
|
18
|
-
|
19
|
-
|
20
|
-
Scenario: Access an entity by ID should return the entity type
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
Scenario: Entity should have the correct accessors
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
Scenario: Entity should fill values
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
Scenario: Navigation Properties should be included in results
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
14
|
+
# Scenario: Service should not respond to an invalid collection
|
15
|
+
# Then I should not be able to call "X" on the service
|
16
|
+
#
|
17
|
+
# Scenario: Service should respond to accessing a single entity by ID
|
18
|
+
# Then I should be able to call "Categories" on the service with args: "1"
|
19
|
+
#
|
20
|
+
# Scenario: Access an entity by ID should return the entity type
|
21
|
+
# Given I call "AddToCategories" on the service with a new "Category" object with Name: "Test Category"
|
22
|
+
# And I save changes
|
23
|
+
# And I call "Categories" on the service with args: "1"
|
24
|
+
# When I run the query
|
25
|
+
# Then the first result should be of type "Category"
|
26
|
+
#
|
27
|
+
# Scenario: Entity should have the correct accessors
|
28
|
+
# Given I call "AddToCategories" on the service with a new "Category" object with Name: "Test Category"
|
29
|
+
# And I save changes
|
30
|
+
# And I call "Categories" on the service with args: "1"
|
31
|
+
# When I run the query
|
32
|
+
# Then the first result should have a method: "Id"
|
33
|
+
# And the first result should have a method: "Name"
|
34
|
+
#
|
35
|
+
# Scenario: Entity should fill values
|
36
|
+
# Given I call "AddToCategories" on the service with a new "Category" object with Name: "Test Category"
|
37
|
+
# And I save changes
|
38
|
+
# And I call "Categories" on the service with args: "1"
|
39
|
+
# When I run the query
|
40
|
+
# Then the method "Id" on the first result should equal: "1"
|
41
|
+
# And the method "Name" on the first result should equal: "Test Category"
|
42
|
+
#
|
43
|
+
# Scenario: Navigation Properties should be included in results
|
44
|
+
# Given I call "AddToProducts" on the service with a new "Product" object
|
45
|
+
# And I save changes
|
46
|
+
# And I call "Products" on the service with args: "1"
|
47
|
+
# When I run the query
|
48
|
+
# Then the first result should have a method: "Category"
|
49
|
+
# And the method "Category" on the first result should be nil
|
50
|
+
#
|
@@ -1,38 +1,38 @@
|
|
1
|
-
@service_methods
|
2
|
-
Feature: Service methods
|
3
|
-
In order to use a WCF Data Service more efficiently
|
4
|
-
As a consumer
|
5
|
-
I want to be able to utilize custom WCF DS methods
|
6
|
-
|
7
|
-
Background:
|
8
|
-
Given a HTTP ODataService exists
|
9
|
-
And blueprints exist for the service
|
10
|
-
|
11
|
-
|
12
|
-
Scenario: A custom web get (no parameters) that returns an entity
|
13
|
-
Given a category exists
|
14
|
-
And I call the service method "EntityCategoryWebGet"
|
15
|
-
Then the first result should be of type "Category"
|
16
|
-
|
17
|
-
Scenario: A custom web get (with parameters) that returns a single entity
|
18
|
-
Given a category: "cat1" exists with Id: 1
|
19
|
-
When I call the service method "EntitySingleCategoryWebGet" with 1
|
20
|
-
Then the result should be of type "Category"
|
21
|
-
And the method "Id" on the result should equal: "1"
|
22
|
-
|
23
|
-
Scenario: A custom web get that returns a collection of primitive types
|
24
|
-
Given the following categories exist:
|
25
|
-
| Name |
|
26
|
-
| Cat1 |
|
27
|
-
| Cat2 |
|
28
|
-
| Cat3 |
|
29
|
-
When I call the service method "CategoryNames"
|
30
|
-
Then the primitive results should be:
|
31
|
-
| Cat1 |
|
32
|
-
| Cat2 |
|
33
|
-
| Cat3 |
|
34
|
-
|
35
|
-
Scenario: A custom web get that returns a single primitive type
|
36
|
-
Given a category exists
|
37
|
-
When I call the service method "FirstCategoryId"
|
38
|
-
Then the integer result should be 1
|
1
|
+
@service_methods
|
2
|
+
Feature: Service methods
|
3
|
+
In order to use a WCF Data Service more efficiently
|
4
|
+
As a consumer
|
5
|
+
I want to be able to utilize custom WCF DS methods
|
6
|
+
|
7
|
+
Background:
|
8
|
+
Given a HTTP ODataService exists
|
9
|
+
And blueprints exist for the service
|
10
|
+
|
11
|
+
|
12
|
+
Scenario: A custom web get (no parameters) that returns an entity
|
13
|
+
Given a category exists
|
14
|
+
And I call the service method "EntityCategoryWebGet"
|
15
|
+
Then the first result should be of type "Category"
|
16
|
+
|
17
|
+
Scenario: A custom web get (with parameters) that returns a single entity
|
18
|
+
Given a category: "cat1" exists with Id: 1
|
19
|
+
When I call the service method "EntitySingleCategoryWebGet" with 1
|
20
|
+
Then the result should be of type "Category"
|
21
|
+
And the method "Id" on the result should equal: "1"
|
22
|
+
|
23
|
+
Scenario: A custom web get that returns a collection of primitive types
|
24
|
+
Given the following categories exist:
|
25
|
+
| Name |
|
26
|
+
| Cat1 |
|
27
|
+
| Cat2 |
|
28
|
+
| Cat3 |
|
29
|
+
When I call the service method "CategoryNames"
|
30
|
+
Then the primitive results should be:
|
31
|
+
| Cat1 |
|
32
|
+
| Cat2 |
|
33
|
+
| Cat3 |
|
34
|
+
|
35
|
+
Scenario: A custom web get that returns a single primitive type
|
36
|
+
Given a category exists
|
37
|
+
When I call the service method "FirstCategoryId"
|
38
|
+
Then the integer result should be 1
|