ruby_odata 0.1.0 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.coveralls.yml +1 -0
- data/.gitignore +7 -2
- data/.simplecov +10 -0
- data/.travis.yml +10 -4
- data/.yardopts +6 -0
- data/CHANGELOG.md +157 -0
- data/Guardfile +14 -0
- data/LICENSE +20 -22
- data/README.md +289 -0
- data/Rakefile +19 -9
- data/features/basic_auth.feature +3 -2
- data/features/batch_request.feature +7 -6
- data/features/cassettes/basic_auth_protected_resource.yml +57 -0
- data/features/cassettes/batch_request_additions.yml +69 -0
- data/features/cassettes/batch_request_deletes.yml +69 -0
- data/features/cassettes/batch_request_updates.yml +69 -0
- data/features/cassettes/clean_database_for_testing.yml +46 -0
- data/features/cassettes/cucumber_tags/basic_auth.yml +297 -0
- data/features/cassettes/cucumber_tags/batch_request.yml +1459 -0
- data/features/cassettes/cucumber_tags/complex_types.yml +326 -0
- data/features/cassettes/cucumber_tags/error_handling.yml +64 -0
- data/features/cassettes/cucumber_tags/query_builder.yml +2025 -0
- data/features/cassettes/cucumber_tags/service.yml +234 -0
- data/features/cassettes/cucumber_tags/service_manage.yml +937 -0
- data/features/cassettes/cucumber_tags/service_methods.yml +647 -0
- data/features/cassettes/cucumber_tags/ssl.yml +203 -0
- data/features/cassettes/cucumber_tags/type_conversion.yml +337 -0
- data/features/cassettes/service_manage_additions.yml +65 -0
- data/features/cassettes/service_manage_deletions.yml +58 -0
- data/features/cassettes/service_manage_deletions_2.yml +58 -0
- data/features/cassettes/unsecured_metadata.yml +89 -0
- data/features/complex_types.feature +4 -3
- data/features/error_handling.feature +13 -0
- data/features/query_builder.feature +30 -9
- data/features/service.feature +4 -3
- data/features/service_manage.feature +6 -5
- data/features/service_methods.feature +3 -2
- data/features/ssl.feature +8 -8
- data/features/step_definitions/service_steps.rb +32 -74
- data/features/support/env.rb +6 -3
- data/features/support/hooks.rb +3 -2
- data/features/support/pickle.rb +29 -18
- data/features/support/vcr.rb +24 -0
- data/features/type_conversion.feature +16 -17
- data/gemfiles/Gemfile.ruby187 +6 -0
- data/lib/ruby_odata.rb +20 -18
- data/lib/ruby_odata/association.rb +7 -6
- data/lib/ruby_odata/class_builder.rb +31 -14
- data/lib/ruby_odata/exceptions.rb +11 -0
- data/lib/ruby_odata/helpers.rb +17 -0
- data/lib/ruby_odata/operation.rb +5 -6
- data/lib/ruby_odata/property_metadata.rb +9 -7
- data/lib/ruby_odata/query_builder.rb +127 -63
- data/lib/ruby_odata/service.rb +265 -147
- data/lib/ruby_odata/version.rb +3 -1
- data/ruby_odata.gemspec +22 -13
- data/spec/fixtures/error_without_message.xml +5 -0
- data/spec/fixtures/int64_ids/edmx_boat_service.xml +19 -0
- data/spec/fixtures/int64_ids/edmx_car_service.xml +21 -0
- data/spec/fixtures/int64_ids/result_boats.xml +26 -0
- data/spec/fixtures/int64_ids/result_cars.xml +28 -0
- data/spec/fixtures/ms_system_center/edmx_ms_system_center.xml +1645 -0
- data/spec/fixtures/ms_system_center/edmx_ms_system_center_v2.xml +2120 -0
- data/spec/fixtures/ms_system_center/hardware_profiles.xml +61 -0
- data/spec/fixtures/ms_system_center/virtual_machines.xml +175 -0
- data/spec/fixtures/ms_system_center/vm_templates.xml +1193 -0
- data/spec/fixtures/nested_expands/edmx_northwind.xml +557 -0
- data/spec/fixtures/nested_expands/northwind_products_category_expands.xml +774 -0
- data/spec/fixtures/sample_service/result_select_categories_expand.xml +268 -0
- data/spec/fixtures/sample_service/result_select_categories_no_property.xml +6 -0
- data/spec/fixtures/sample_service/result_select_categories_travsing_no_expand.xml +6 -0
- data/spec/fixtures/sample_service/result_select_products_name_price.xml +92 -0
- data/spec/property_metadata_spec.rb +10 -10
- data/spec/query_builder_spec.rb +153 -14
- data/spec/revised_service_spec.rb +111 -6
- data/spec/service_spec.rb +389 -85
- data/spec/spec_helper.rb +3 -0
- data/spec/support/sample_service_matcher.rb +15 -0
- data/test/RubyODataService/RubyODataService/App_Data/.gitkeep +0 -0
- data/test/blueprints.rb +15 -9
- data/test/usage_samples/querying.rb +5 -1
- data/test/usage_samples/sample_data.rb +1 -3
- metadata +276 -76
- data/CHANGELOG.rdoc +0 -88
- data/README.rdoc +0 -259
@@ -0,0 +1,65 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: http://win7dev:8989/SampleService/RubyOData.svc/Products
|
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"}}'
|
10
|
+
headers:
|
11
|
+
Accept:
|
12
|
+
- ! '*/*; q=0.5, application/xml'
|
13
|
+
Accept-Encoding:
|
14
|
+
- gzip, deflate
|
15
|
+
Content-Type:
|
16
|
+
- application/json
|
17
|
+
Content-Length:
|
18
|
+
- '185'
|
19
|
+
User-Agent:
|
20
|
+
- Ruby
|
21
|
+
response:
|
22
|
+
status:
|
23
|
+
code: 201
|
24
|
+
message: Created
|
25
|
+
headers:
|
26
|
+
Cache-Control:
|
27
|
+
- no-cache
|
28
|
+
Content-Length:
|
29
|
+
- '1441'
|
30
|
+
Content-Type:
|
31
|
+
- application/atom+xml;type=entry;charset=utf-8
|
32
|
+
Location:
|
33
|
+
- http://win7dev:8989/SampleService/RubyOData.svc/Products(1)
|
34
|
+
Server:
|
35
|
+
- Microsoft-IIS/7.5
|
36
|
+
Set-Cookie:
|
37
|
+
- ASP.NET_SessionId=3gkn5afndwqci0z3nznzu0bm; path=/; HttpOnly
|
38
|
+
X-Content-Type-Options:
|
39
|
+
- nosniff
|
40
|
+
Dataserviceversion:
|
41
|
+
- 1.0;
|
42
|
+
X-Aspnet-Version:
|
43
|
+
- 4.0.30319
|
44
|
+
X-Powered-By:
|
45
|
+
- ASP.NET
|
46
|
+
Date:
|
47
|
+
- Tue, 07 Aug 2012 21:47:36 GMT
|
48
|
+
body:
|
49
|
+
encoding: US-ASCII
|
50
|
+
string: <?xml version="1.0" encoding="utf-8"?><entry xml:base="http://win7dev:8989/SampleService/RubyOData.svc/"
|
51
|
+
xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices"
|
52
|
+
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
|
54
|
+
term="RubyODataService.Product" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"
|
55
|
+
/><link rel="edit" title="Product" href="Products(1)" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Category"
|
56
|
+
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
|
58
|
+
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
|
60
|
+
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
|
@@ -0,0 +1,58 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://win7dev:8989/SampleService/RubyOData.svc/Products(1)
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- ! '*/*; q=0.5, application/xml'
|
12
|
+
Accept-Encoding:
|
13
|
+
- gzip, deflate
|
14
|
+
User-Agent:
|
15
|
+
- Ruby
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
Cache-Control:
|
22
|
+
- no-cache
|
23
|
+
Content-Length:
|
24
|
+
- '1431'
|
25
|
+
Content-Type:
|
26
|
+
- application/atom+xml;type=entry;charset=utf-8
|
27
|
+
Server:
|
28
|
+
- Microsoft-IIS/7.5
|
29
|
+
Set-Cookie:
|
30
|
+
- ASP.NET_SessionId=pqd44q53aamnklanqbym2pcu; path=/; HttpOnly
|
31
|
+
X-Content-Type-Options:
|
32
|
+
- nosniff
|
33
|
+
Dataserviceversion:
|
34
|
+
- 1.0;
|
35
|
+
X-Aspnet-Version:
|
36
|
+
- 4.0.30319
|
37
|
+
X-Powered-By:
|
38
|
+
- ASP.NET
|
39
|
+
Date:
|
40
|
+
- Tue, 07 Aug 2012 21:47:37 GMT
|
41
|
+
body:
|
42
|
+
encoding: US-ASCII
|
43
|
+
string: <?xml version="1.0" encoding="utf-8"?><entry xml:base="http://win7dev:8989/SampleService/RubyOData.svc/"
|
44
|
+
xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices"
|
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
|
47
|
+
term="RubyODataService.Product" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"
|
48
|
+
/><link rel="edit" title="Product" href="Products(1)" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Category"
|
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
|
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
|
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
|
@@ -0,0 +1,58 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://win7dev:8989/SampleService/RubyOData.svc/Products(1)
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- ! '*/*; q=0.5, application/xml'
|
12
|
+
Accept-Encoding:
|
13
|
+
- gzip, deflate
|
14
|
+
User-Agent:
|
15
|
+
- Ruby
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
Cache-Control:
|
22
|
+
- no-cache
|
23
|
+
Content-Length:
|
24
|
+
- '1439'
|
25
|
+
Content-Type:
|
26
|
+
- application/atom+xml;type=entry;charset=utf-8
|
27
|
+
Server:
|
28
|
+
- Microsoft-IIS/7.5
|
29
|
+
Set-Cookie:
|
30
|
+
- ASP.NET_SessionId=1jtoo2ua0isload4ewywcbyh; path=/; HttpOnly
|
31
|
+
X-Content-Type-Options:
|
32
|
+
- nosniff
|
33
|
+
Dataserviceversion:
|
34
|
+
- 1.0;
|
35
|
+
X-Aspnet-Version:
|
36
|
+
- 4.0.30319
|
37
|
+
X-Powered-By:
|
38
|
+
- ASP.NET
|
39
|
+
Date:
|
40
|
+
- Tue, 07 Aug 2012 21:47:37 GMT
|
41
|
+
body:
|
42
|
+
encoding: US-ASCII
|
43
|
+
string: <?xml version="1.0" encoding="utf-8"?><entry xml:base="http://win7dev:8989/SampleService/RubyOData.svc/"
|
44
|
+
xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices"
|
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
|
47
|
+
term="RubyODataService.Product" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"
|
48
|
+
/><link rel="edit" title="Product" href="Products(1)" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Category"
|
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
|
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
|
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
|
@@ -0,0 +1,89 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://win7dev:8989/SampleService/RubyOData.svc/$metadata
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- ! '*/*; q=0.5, application/xml'
|
12
|
+
Accept-Encoding:
|
13
|
+
- gzip, deflate
|
14
|
+
User-Agent:
|
15
|
+
- Ruby
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
Cache-Control:
|
22
|
+
- no-cache
|
23
|
+
Content-Length:
|
24
|
+
- '4055'
|
25
|
+
Content-Type:
|
26
|
+
- application/xml;charset=utf-8
|
27
|
+
Server:
|
28
|
+
- Microsoft-IIS/7.5
|
29
|
+
Set-Cookie:
|
30
|
+
- ASP.NET_SessionId=tvkikr3xqyy43kcx0mk1uwdr; path=/; HttpOnly
|
31
|
+
X-Content-Type-Options:
|
32
|
+
- nosniff
|
33
|
+
Dataserviceversion:
|
34
|
+
- 1.0;
|
35
|
+
X-Aspnet-Version:
|
36
|
+
- 4.0.30319
|
37
|
+
X-Powered-By:
|
38
|
+
- ASP.NET
|
39
|
+
Date:
|
40
|
+
- Tue, 07 Aug 2012 21:47:40 GMT
|
41
|
+
body:
|
42
|
+
encoding: US-ASCII
|
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
|
+
m:DataServiceVersion="1.0" m:MaxDataServiceVersion="3.0" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"><Schema
|
45
|
+
Namespace="RubyODataService" xmlns="http://schemas.microsoft.com/ado/2008/09/edm"><EntityType
|
46
|
+
Name="Product"><Key><PropertyRef Name="Id" /></Key><Property Name="Id" Type="Edm.Int32"
|
47
|
+
Nullable="false" p6:StoreGeneratedPattern="Identity" xmlns:p6="http://schemas.microsoft.com/ado/2009/02/edm/annotation"
|
48
|
+
/><Property Name="Name" Type="Edm.String" MaxLength="4000" FixedLength="false"
|
49
|
+
Unicode="true" /><Property Name="Description" Type="Edm.String" MaxLength="4000"
|
50
|
+
FixedLength="false" Unicode="true" /><Property Name="Price" Type="Edm.Decimal"
|
51
|
+
Nullable="false" Precision="18" Scale="2" /><Property Name="DiscontinuedDate"
|
52
|
+
Type="Edm.DateTime" /><Property Name="CategoryId" Type="Edm.Int32" Nullable="false"
|
53
|
+
/><Property Name="AuditFields" Type="RubyODataService.AuditFields" Nullable="false"
|
54
|
+
/><NavigationProperty Name="Category" Relationship="RubyODataService.Category_Products"
|
55
|
+
ToRole="Category_Products_Source" FromRole="Category_Products_Target" /></EntityType><ComplexType
|
56
|
+
Name="AuditFields"><Property Name="CreateDate" Type="Edm.DateTime" Nullable="false"
|
57
|
+
/><Property Name="ModifiedDate" Type="Edm.DateTime" Nullable="false" /><Property
|
58
|
+
Name="CreatedBy" Type="Edm.String" MaxLength="4000" FixedLength="false" Unicode="true"
|
59
|
+
/></ComplexType><EntityType Name="Category"><Key><PropertyRef Name="Id" /></Key><Property
|
60
|
+
Name="Id" Type="Edm.Int32" Nullable="false" p6:StoreGeneratedPattern="Identity"
|
61
|
+
xmlns:p6="http://schemas.microsoft.com/ado/2009/02/edm/annotation" /><Property
|
62
|
+
Name="Name" Type="Edm.String" MaxLength="4000" FixedLength="false" Unicode="true"
|
63
|
+
/><Property Name="AuditFields" Type="RubyODataService.AuditFields" Nullable="false"
|
64
|
+
/><NavigationProperty Name="Products" Relationship="RubyODataService.Category_Products"
|
65
|
+
ToRole="Category_Products_Target" FromRole="Category_Products_Source" /></EntityType><EntityType
|
66
|
+
Name="EdmMetadata"><Key><PropertyRef Name="Id" /></Key><Property Name="Id"
|
67
|
+
Type="Edm.Int32" Nullable="false" p6:StoreGeneratedPattern="Identity" xmlns:p6="http://schemas.microsoft.com/ado/2009/02/edm/annotation"
|
68
|
+
/><Property Name="ModelHash" Type="Edm.String" MaxLength="4000" FixedLength="false"
|
69
|
+
Unicode="true" /></EntityType><Association Name="Category_Products"><End Type="RubyODataService.Product"
|
70
|
+
Role="Category_Products_Target" Multiplicity="*" /><End Type="RubyODataService.Category"
|
71
|
+
Role="Category_Products_Source" Multiplicity="1"><OnDelete Action="Cascade"
|
72
|
+
/></End><ReferentialConstraint><Principal Role="Category_Products_Source"><PropertyRef
|
73
|
+
Name="Id" /></Principal><Dependent Role="Category_Products_Target"><PropertyRef
|
74
|
+
Name="CategoryId" /></Dependent></ReferentialConstraint></Association><EntityContainer
|
75
|
+
Name="RubyODataContext" m:IsDefaultEntityContainer="true"><EntitySet Name="Products"
|
76
|
+
EntityType="RubyODataService.Product" /><EntitySet Name="Categories" EntityType="RubyODataService.Category"
|
77
|
+
/><EntitySet Name="EdmMetadatas" EntityType="RubyODataService.EdmMetadata"
|
78
|
+
/><AssociationSet Name="Category_Products" Association="RubyODataService.Category_Products"><End
|
79
|
+
Role="Category_Products_Target" EntitySet="Products" /><End Role="Category_Products_Source"
|
80
|
+
EntitySet="Categories" /></AssociationSet><FunctionImport Name="CleanDatabaseForTesting"
|
81
|
+
m:HttpMethod="POST" /><FunctionImport Name="EntityCategoryWebGet" ReturnType="Collection(RubyODataService.Category)"
|
82
|
+
EntitySet="Categories" m:HttpMethod="GET" /><FunctionImport Name="CategoryNames"
|
83
|
+
ReturnType="Collection(Edm.String)" m:HttpMethod="GET" /><FunctionImport Name="FirstCategoryId"
|
84
|
+
ReturnType="Edm.Int32" m:HttpMethod="GET" /><FunctionImport Name="EntitySingleCategoryWebGet"
|
85
|
+
ReturnType="RubyODataService.Category" EntitySet="Categories" m:HttpMethod="GET"><Parameter
|
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
|
@@ -1,3 +1,4 @@
|
|
1
|
+
@complex_types
|
1
2
|
Feature: Complex types
|
2
3
|
In order to fully support OData services
|
3
4
|
As a user of ruby_odata
|
@@ -12,7 +13,7 @@ Scenario: The proxy must generate classes for complex types if they exist
|
|
12
13
|
|
13
14
|
Scenario: Complex properties on an entity must be the correct type
|
14
15
|
Given I call "AddToProducts" on the service with a new "Product" object
|
15
|
-
And I save changes
|
16
|
+
And I save changes
|
16
17
|
And I call "Products" on the service with args: "1"
|
17
18
|
When I run the query
|
18
19
|
Then the first result should have a method: "AuditFields"
|
@@ -25,10 +26,10 @@ Scenario: Complex properties on an entity must be filled
|
|
25
26
|
When I run the query
|
26
27
|
Then the first result should have a method: "AuditFields"
|
27
28
|
When I call "CreateDate" for "AuditFields" on the first result
|
28
|
-
Then the operation should not be null
|
29
|
+
Then the operation should not be null
|
29
30
|
|
30
31
|
# TODO: This scenario should have the AuditFields.CreatedBy field set in the Given
|
31
|
-
# instead it is set by the blueprint
|
32
|
+
# instead it is set by the blueprint
|
32
33
|
Scenario: Complex properties should be able to be added
|
33
34
|
Given I call "AddToProducts" on the service with a new "Product" object
|
34
35
|
And I save changes
|
@@ -0,0 +1,13 @@
|
|
1
|
+
@error_handling
|
2
|
+
Feature: Error handling
|
3
|
+
In order to assist debugging
|
4
|
+
As a user
|
5
|
+
I want more debug information when an error occurs communicating with the server
|
6
|
+
|
7
|
+
Background:
|
8
|
+
Given a HTTP ODataService exists
|
9
|
+
And blueprints exist for the service
|
10
|
+
|
11
|
+
Scenario: Violate a data type conversion (empty string to decimal)
|
12
|
+
Given I call "AddToProducts" on the service with a new "Product" object with Price: ""
|
13
|
+
When I save changes it should throw an exception with message containing "Error encountered in converting the value"
|
@@ -1,7 +1,8 @@
|
|
1
|
+
@query_builder
|
1
2
|
Feature: Query Builder
|
2
3
|
In order to query OData services
|
3
4
|
As a user
|
4
|
-
I want to be able to perform valid OData protocol operations
|
5
|
+
I want to be able to perform valid OData protocol operations
|
5
6
|
|
6
7
|
Background:
|
7
8
|
Given a HTTP ODataService exists
|
@@ -12,7 +13,7 @@ Scenario: Navigation Properties should be able to be eager loaded
|
|
12
13
|
Given I call "AddToCategories" on the service with a new "Category" object with Name: "Test Category"
|
13
14
|
And I save changes
|
14
15
|
And I call "AddToProducts" on the service with a new "Product" object with Category: "@@LastSave.first"
|
15
|
-
And I save changes
|
16
|
+
And I save changes
|
16
17
|
And I call "Products" on the service with args: "1"
|
17
18
|
And I expand the query to include "Category"
|
18
19
|
When I run the query
|
@@ -99,14 +100,14 @@ Scenario: Skip should be allowed on the root level entity
|
|
99
100
|
| Product 2 |
|
100
101
|
| Product 3 |
|
101
102
|
| Product 4 |
|
102
|
-
| Product 5 |
|
103
|
+
| Product 5 |
|
103
104
|
When I call "Products" on the service
|
104
105
|
And I skip 3
|
105
106
|
And I run the query
|
106
107
|
Then the result should be:
|
107
108
|
| Name |
|
108
109
|
| Product 4 |
|
109
|
-
| Product 5 |
|
110
|
+
| Product 5 |
|
110
111
|
|
111
112
|
|
112
113
|
# Top
|
@@ -117,14 +118,14 @@ Scenario: Top should be allowed on the root level entity
|
|
117
118
|
| Product 2 |
|
118
119
|
| Product 3 |
|
119
120
|
| Product 4 |
|
120
|
-
| Product 5 |
|
121
|
+
| Product 5 |
|
121
122
|
When I call "Products" on the service
|
122
123
|
And I ask for the top 3
|
123
124
|
And I run the query
|
124
125
|
Then the result should be:
|
125
126
|
| Name |
|
126
127
|
| Product 1 |
|
127
|
-
| Product 2 |
|
128
|
+
| Product 2 |
|
128
129
|
| Product 3 |
|
129
130
|
|
130
131
|
Scenario: Top should be able to be used along with skip for paging
|
@@ -134,8 +135,8 @@ Scenario: Top should be able to be used along with skip for paging
|
|
134
135
|
| Product 2 |
|
135
136
|
| Product 3 |
|
136
137
|
| Product 4 |
|
137
|
-
| Product 5 |
|
138
|
-
| Product 6 |
|
138
|
+
| Product 5 |
|
139
|
+
| Product 6 |
|
139
140
|
When I call "Products" on the service
|
140
141
|
And I skip 2
|
141
142
|
And I ask for the top 2
|
@@ -143,7 +144,7 @@ Scenario: Top should be able to be used along with skip for paging
|
|
143
144
|
Then the result should be:
|
144
145
|
| Name |
|
145
146
|
| Product 3 |
|
146
|
-
| Product 4 |
|
147
|
+
| Product 4 |
|
147
148
|
|
148
149
|
|
149
150
|
# Links
|
@@ -160,3 +161,23 @@ Scenario: Navigation Properties should be able to represented as links
|
|
160
161
|
And I run the query
|
161
162
|
Then the result count should be 3
|
162
163
|
Then the method "path" on the first result should equal: "/SampleService/RubyOData.svc/Products(1)"
|
164
|
+
|
165
|
+
# Count
|
166
|
+
Scenario: Count should be able to be used on a root collection
|
167
|
+
Given 4 products exist
|
168
|
+
When I call "Products" on the service
|
169
|
+
And I ask for the count
|
170
|
+
And I run the query
|
171
|
+
Then the integer result should be 4
|
172
|
+
|
173
|
+
Scenario: Count should be able to be used on with a filter
|
174
|
+
Given the following products exist:
|
175
|
+
| Name |
|
176
|
+
| Product 1 |
|
177
|
+
| Product 2 |
|
178
|
+
When I call "Products" on the service
|
179
|
+
And I filter the query with: "Name eq 'Product 2'"
|
180
|
+
And I ask for the count
|
181
|
+
And I run the query
|
182
|
+
Then the integer result should be 1
|
183
|
+
|
data/features/service.feature
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
@service
|
1
2
|
Feature: Service Should Generate a Proxy
|
2
3
|
In order to consume the OData
|
3
4
|
As a user
|
@@ -30,7 +31,7 @@ Scenario: Entity should have the correct accessors
|
|
30
31
|
When I run the query
|
31
32
|
Then the first result should have a method: "Id"
|
32
33
|
And the first result should have a method: "Name"
|
33
|
-
|
34
|
+
|
34
35
|
Scenario: Entity should fill values
|
35
36
|
Given I call "AddToCategories" on the service with a new "Category" object with Name: "Test Category"
|
36
37
|
And I save changes
|
@@ -39,9 +40,9 @@ Scenario: Entity should fill values
|
|
39
40
|
Then the method "Id" on the first result should equal: "1"
|
40
41
|
And the method "Name" on the first result should equal: "Test Category"
|
41
42
|
|
42
|
-
Scenario: Navigation Properties should be included in results
|
43
|
+
Scenario: Navigation Properties should be included in results
|
43
44
|
Given I call "AddToProducts" on the service with a new "Product" object
|
44
|
-
And I save changes
|
45
|
+
And I save changes
|
45
46
|
And I call "Products" on the service with args: "1"
|
46
47
|
When I run the query
|
47
48
|
Then the first result should have a method: "Category"
|
@@ -1,3 +1,4 @@
|
|
1
|
+
@service_manage
|
1
2
|
Feature: Service management
|
2
3
|
In order to manage entities
|
3
4
|
As a admin
|
@@ -9,7 +10,7 @@ Background:
|
|
9
10
|
|
10
11
|
Scenario: Service should respond to AddToEntityName for adding objects
|
11
12
|
Given I call "AddToProducts" on the service with a new "Product" object with Name: "Sample Product"
|
12
|
-
When I save changes
|
13
|
+
When I save changes within a cassette named "service_manage_additions"
|
13
14
|
Then the first save result should be of type "Product"
|
14
15
|
And the method "Name" on the first save result should equal: "Sample Product"
|
15
16
|
|
@@ -19,7 +20,7 @@ Scenario: Service should allow for deletes
|
|
19
20
|
Then the first save result should be of type "Product"
|
20
21
|
When I call "delete_object" on the service with the first last save result
|
21
22
|
And I save changes
|
22
|
-
Then the save result should equal: "true"
|
23
|
+
Then the save result should equal: "true"
|
23
24
|
And no "Products" should exist
|
24
25
|
|
25
26
|
Scenario: Untracked entities shouldn't be able to be deleted
|
@@ -29,7 +30,7 @@ Scenario: Entities should be able to be updated
|
|
29
30
|
Given I call "AddToProducts" on the service with a new "Product" object with Name: "Test Product"
|
30
31
|
When I save changes
|
31
32
|
And I call "Products" on the service with args: "1"
|
32
|
-
And I run the query
|
33
|
+
And I run the query within a cassette named "service_manage_deletions"
|
33
34
|
Then the method "Name" on the first result should equal: "Test Product"
|
34
35
|
When I set "Name" on the first result to "Changed Test Product"
|
35
36
|
Then the method "Name" on the first result should equal: "Changed Test Product"
|
@@ -37,7 +38,7 @@ Scenario: Entities should be able to be updated
|
|
37
38
|
And I save changes
|
38
39
|
Then the save result should equal: "true"
|
39
40
|
When I call "Products" on the service with args: "1"
|
40
|
-
And I run the query
|
41
|
+
And I run the query within a cassette named "service_manage_deletions_2"
|
41
42
|
Then the method "Name" on the first result should equal: "Changed Test Product"
|
42
43
|
|
43
44
|
Scenario: Untracked entities shouldn't be able to be updated
|
@@ -47,7 +48,7 @@ Scenario: Related entities shouldn't be recreated on a child add
|
|
47
48
|
Given I call "AddToCategories" on the service with a new "Category" object with Name: "Test Category"
|
48
49
|
And I save changes
|
49
50
|
And I call "AddToProducts" on the service with a new "Product" object with Category: "@@LastSave.first"
|
50
|
-
And I save changes
|
51
|
+
And I save changes
|
51
52
|
And I call "Products" on the service with args: "1"
|
52
53
|
And I expand the query to include "Category"
|
53
54
|
When I run the query
|