ruby_odata 0.1.6 → 0.2.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +2 -0
  3. data/CHANGELOG.md +5 -0
  4. data/Gemfile +2 -0
  5. data/Guardfile +1 -1
  6. data/features/basic_auth.feature +13 -13
  7. data/features/cassettes/basic_auth_protected_resource.yml +22 -20
  8. data/features/cassettes/batch_request_additions.yml +26 -26
  9. data/features/cassettes/batch_request_deletes.yml +27 -27
  10. data/features/cassettes/batch_request_updates.yml +26 -26
  11. data/features/cassettes/clean_database_for_testing.yml +10 -10
  12. data/features/cassettes/cucumber_tags/basic_auth.yml +54 -163
  13. data/features/cassettes/cucumber_tags/batch_request.yml +229 -1118
  14. data/features/cassettes/cucumber_tags/complex_types.yml +81 -191
  15. data/features/cassettes/cucumber_tags/error_handling.yml +45 -33
  16. data/features/cassettes/cucumber_tags/query_builder.yml +555 -1248
  17. data/features/cassettes/cucumber_tags/service_manage.yml +216 -591
  18. data/features/cassettes/cucumber_tags/service_methods.yml +137 -412
  19. data/features/cassettes/cucumber_tags/ssl.yml +121 -117
  20. data/features/cassettes/cucumber_tags/type_conversion.yml +104 -170
  21. data/features/cassettes/service_manage_additions.yml +26 -28
  22. data/features/cassettes/service_manage_deletions.yml +21 -21
  23. data/features/cassettes/service_manage_deletions_2.yml +21 -21
  24. data/features/cassettes/unsecured_metadata.yml +14 -14
  25. data/features/service.feature +37 -37
  26. data/features/service_methods.feature +38 -38
  27. data/features/step_definitions/pickle_steps.rb +5 -5
  28. data/features/step_definitions/service_steps.rb +26 -26
  29. data/features/support/hooks.rb +3 -2
  30. data/features/support/vcr.rb +13 -13
  31. data/lib/ruby_odata.rb +4 -1
  32. data/lib/ruby_odata/association.rb +15 -8
  33. data/lib/ruby_odata/class_builder.rb +5 -1
  34. data/lib/ruby_odata/query_builder.rb +171 -173
  35. data/lib/ruby_odata/resource.rb +153 -0
  36. data/lib/ruby_odata/service.rb +30 -30
  37. data/lib/ruby_odata/version.rb +1 -1
  38. data/ruby_odata.gemspec +48 -43
  39. data/spec/association_spec.rb +15 -11
  40. data/spec/fixtures/decimal/metadata.xml +1 -0
  41. data/spec/fixtures/v4/edmx_metadata.xml +145 -0
  42. data/spec/fixtures/v4/result_categories.xml +0 -0
  43. data/spec/revised_service_spec.rb +16 -11
  44. data/spec/service_spec.rb +149 -114
  45. data/spec/service_v4_spec.rb +102 -0
  46. data/spec/spec_helper.rb +6 -1
  47. metadata +109 -32
  48. 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://win7dev:8989/SampleService/RubyOData.svc/Products
5
+ uri: http://10.10.0.17:8989/SampleService/RubyOData.svc/Products
6
6
  body:
7
- encoding: ASCII-8BIT
8
- string: ! '{"Name":"Sample Product","Description":"Test Widget","Price":"10.25","Category":{"Name":"Category
9
- 0001","AuditFields":{"CreatedBy":"Machinist"}},"AuditFields":{"CreatedBy":"Machinist"}}'
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
- - ! '*/*; q=0.5, application/xml'
13
- Accept-Encoding:
14
- - gzip, deflate
14
+ - "*/*; q=0.5, application/xml"
15
15
  Content-Type:
16
16
  - application/json
17
- Content-Length:
18
- - '185'
19
- User-Agent:
20
- - Ruby
17
+ Accept-Encoding:
18
+ - gzip,deflate
21
19
  response:
22
20
  status:
23
21
  code: 201
24
- message: Created
22
+ message: ''
25
23
  headers:
26
24
  Cache-Control:
27
- - no-cache
25
+ - private
28
26
  Content-Length:
29
- - '1441'
27
+ - '1447'
30
28
  Content-Type:
31
29
  - application/atom+xml;type=entry;charset=utf-8
32
30
  Location:
33
- - http://win7dev:8989/SampleService/RubyOData.svc/Products(1)
31
+ - http://10.10.0.17:8989/SampleService/RubyOData.svc/Products(1)
34
32
  Server:
35
- - Microsoft-IIS/7.5
33
+ - Microsoft-IIS/8.0
36
34
  Set-Cookie:
37
- - ASP.NET_SessionId=3gkn5afndwqci0z3nznzu0bm; path=/; HttpOnly
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
- - Tue, 07 Aug 2012 21:47:36 GMT
45
+ - Sun, 26 Apr 2015 16:29:49 GMT
48
46
  body:
49
- encoding: US-ASCII
50
- string: <?xml version="1.0" encoding="utf-8"?><entry xml:base="http://win7dev:8989/SampleService/RubyOData.svc/"
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://win7dev:8989/SampleService/RubyOData.svc/Products(1)</id><category
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>2012-08-07T21:47:37Z</updated><author><name /></author><content
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">10.25</d:Price><d:DiscontinuedDate
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">2012-08-07T21:47:37.171875Z</d:CreateDate><d:ModifiedDate
62
- m:type="Edm.DateTime">2012-08-07T21:47:37.171875Z</d:ModifiedDate><d:CreatedBy>Machinist</d:CreatedBy></d:AuditFields></m:properties></content></entry>
63
- http_version: !!null
64
- recorded_at: Tue, 07 Aug 2012 21:47:37 GMT
65
- recorded_with: VCR 2.2.4
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://win7dev:8989/SampleService/RubyOData.svc/Products(1)
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: OK
19
+ message: ''
20
20
  headers:
21
21
  Cache-Control:
22
- - no-cache
22
+ - private
23
23
  Content-Length:
24
- - '1431'
24
+ - '1437'
25
25
  Content-Type:
26
26
  - application/atom+xml;type=entry;charset=utf-8
27
27
  Server:
28
- - Microsoft-IIS/7.5
28
+ - Microsoft-IIS/8.0
29
29
  Set-Cookie:
30
- - ASP.NET_SessionId=pqd44q53aamnklanqbym2pcu; path=/; HttpOnly
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
- - Tue, 07 Aug 2012 21:47:37 GMT
40
+ - Sun, 26 Apr 2015 16:29:50 GMT
41
41
  body:
42
- encoding: US-ASCII
43
- string: <?xml version="1.0" encoding="utf-8"?><entry xml:base="http://win7dev:8989/SampleService/RubyOData.svc/"
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://win7dev:8989/SampleService/RubyOData.svc/Products(1)</id><category
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>2012-08-07T21:47:38Z</updated><author><name /></author><content
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">10.25</d:Price><d:DiscontinuedDate
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">2012-08-07T21:47:38.157</d:CreateDate><d:ModifiedDate
55
- m:type="Edm.DateTime">2012-08-07T21:47:38.157</d:ModifiedDate><d:CreatedBy>Machinist</d:CreatedBy></d:AuditFields></m:properties></content></entry>
56
- http_version: !!null
57
- recorded_at: Tue, 07 Aug 2012 21:47:38 GMT
58
- recorded_with: VCR 2.2.4
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://win7dev:8989/SampleService/RubyOData.svc/Products(1)
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: OK
19
+ message: ''
20
20
  headers:
21
21
  Cache-Control:
22
- - no-cache
22
+ - private
23
23
  Content-Length:
24
- - '1439'
24
+ - '1445'
25
25
  Content-Type:
26
26
  - application/atom+xml;type=entry;charset=utf-8
27
27
  Server:
28
- - Microsoft-IIS/7.5
28
+ - Microsoft-IIS/8.0
29
29
  Set-Cookie:
30
- - ASP.NET_SessionId=1jtoo2ua0isload4ewywcbyh; path=/; HttpOnly
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
- - Tue, 07 Aug 2012 21:47:37 GMT
40
+ - Sun, 26 Apr 2015 16:29:51 GMT
41
41
  body:
42
- encoding: US-ASCII
43
- string: <?xml version="1.0" encoding="utf-8"?><entry xml:base="http://win7dev:8989/SampleService/RubyOData.svc/"
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://win7dev:8989/SampleService/RubyOData.svc/Products(1)</id><category
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>2012-08-07T21:47:38Z</updated><author><name /></author><content
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">10.25</d:Price><d:DiscontinuedDate
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">2012-08-07T21:47:38.157</d:CreateDate><d:ModifiedDate
55
- m:type="Edm.DateTime">2012-08-07T21:47:38.157</d:ModifiedDate><d:CreatedBy>Machinist</d:CreatedBy></d:AuditFields></m:properties></content></entry>
56
- http_version: !!null
57
- recorded_at: Tue, 07 Aug 2012 21:47:38 GMT
58
- recorded_with: VCR 2.2.4
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://win7dev:8989/SampleService/RubyOData.svc/$metadata
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: OK
19
+ message: ''
20
20
  headers:
21
21
  Cache-Control:
22
- - no-cache
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/7.5
28
+ - Microsoft-IIS/8.0
29
29
  Set-Cookie:
30
- - ASP.NET_SessionId=tvkikr3xqyy43kcx0mk1uwdr; path=/; HttpOnly
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
- - Tue, 07 Aug 2012 21:47:40 GMT
40
+ - Sun, 26 Apr 2015 16:30:01 GMT
41
41
  body:
42
- encoding: US-ASCII
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: !!null
88
- recorded_at: Tue, 07 Aug 2012 21:47:41 GMT
89
- recorded_with: VCR 2.2.4
87
+ http_version:
88
+ recorded_at: Sun, 26 Apr 2015 16:30:02 GMT
89
+ recorded_with: VCR 2.5.0
@@ -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
- 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
-
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