ruby_odata 0.1.0 → 0.1.6

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.
Files changed (86) hide show
  1. checksums.yaml +7 -0
  2. data/.coveralls.yml +1 -0
  3. data/.gitignore +7 -2
  4. data/.simplecov +10 -0
  5. data/.travis.yml +10 -4
  6. data/.yardopts +6 -0
  7. data/CHANGELOG.md +157 -0
  8. data/Guardfile +14 -0
  9. data/LICENSE +20 -22
  10. data/README.md +289 -0
  11. data/Rakefile +19 -9
  12. data/features/basic_auth.feature +3 -2
  13. data/features/batch_request.feature +7 -6
  14. data/features/cassettes/basic_auth_protected_resource.yml +57 -0
  15. data/features/cassettes/batch_request_additions.yml +69 -0
  16. data/features/cassettes/batch_request_deletes.yml +69 -0
  17. data/features/cassettes/batch_request_updates.yml +69 -0
  18. data/features/cassettes/clean_database_for_testing.yml +46 -0
  19. data/features/cassettes/cucumber_tags/basic_auth.yml +297 -0
  20. data/features/cassettes/cucumber_tags/batch_request.yml +1459 -0
  21. data/features/cassettes/cucumber_tags/complex_types.yml +326 -0
  22. data/features/cassettes/cucumber_tags/error_handling.yml +64 -0
  23. data/features/cassettes/cucumber_tags/query_builder.yml +2025 -0
  24. data/features/cassettes/cucumber_tags/service.yml +234 -0
  25. data/features/cassettes/cucumber_tags/service_manage.yml +937 -0
  26. data/features/cassettes/cucumber_tags/service_methods.yml +647 -0
  27. data/features/cassettes/cucumber_tags/ssl.yml +203 -0
  28. data/features/cassettes/cucumber_tags/type_conversion.yml +337 -0
  29. data/features/cassettes/service_manage_additions.yml +65 -0
  30. data/features/cassettes/service_manage_deletions.yml +58 -0
  31. data/features/cassettes/service_manage_deletions_2.yml +58 -0
  32. data/features/cassettes/unsecured_metadata.yml +89 -0
  33. data/features/complex_types.feature +4 -3
  34. data/features/error_handling.feature +13 -0
  35. data/features/query_builder.feature +30 -9
  36. data/features/service.feature +4 -3
  37. data/features/service_manage.feature +6 -5
  38. data/features/service_methods.feature +3 -2
  39. data/features/ssl.feature +8 -8
  40. data/features/step_definitions/service_steps.rb +32 -74
  41. data/features/support/env.rb +6 -3
  42. data/features/support/hooks.rb +3 -2
  43. data/features/support/pickle.rb +29 -18
  44. data/features/support/vcr.rb +24 -0
  45. data/features/type_conversion.feature +16 -17
  46. data/gemfiles/Gemfile.ruby187 +6 -0
  47. data/lib/ruby_odata.rb +20 -18
  48. data/lib/ruby_odata/association.rb +7 -6
  49. data/lib/ruby_odata/class_builder.rb +31 -14
  50. data/lib/ruby_odata/exceptions.rb +11 -0
  51. data/lib/ruby_odata/helpers.rb +17 -0
  52. data/lib/ruby_odata/operation.rb +5 -6
  53. data/lib/ruby_odata/property_metadata.rb +9 -7
  54. data/lib/ruby_odata/query_builder.rb +127 -63
  55. data/lib/ruby_odata/service.rb +265 -147
  56. data/lib/ruby_odata/version.rb +3 -1
  57. data/ruby_odata.gemspec +22 -13
  58. data/spec/fixtures/error_without_message.xml +5 -0
  59. data/spec/fixtures/int64_ids/edmx_boat_service.xml +19 -0
  60. data/spec/fixtures/int64_ids/edmx_car_service.xml +21 -0
  61. data/spec/fixtures/int64_ids/result_boats.xml +26 -0
  62. data/spec/fixtures/int64_ids/result_cars.xml +28 -0
  63. data/spec/fixtures/ms_system_center/edmx_ms_system_center.xml +1645 -0
  64. data/spec/fixtures/ms_system_center/edmx_ms_system_center_v2.xml +2120 -0
  65. data/spec/fixtures/ms_system_center/hardware_profiles.xml +61 -0
  66. data/spec/fixtures/ms_system_center/virtual_machines.xml +175 -0
  67. data/spec/fixtures/ms_system_center/vm_templates.xml +1193 -0
  68. data/spec/fixtures/nested_expands/edmx_northwind.xml +557 -0
  69. data/spec/fixtures/nested_expands/northwind_products_category_expands.xml +774 -0
  70. data/spec/fixtures/sample_service/result_select_categories_expand.xml +268 -0
  71. data/spec/fixtures/sample_service/result_select_categories_no_property.xml +6 -0
  72. data/spec/fixtures/sample_service/result_select_categories_travsing_no_expand.xml +6 -0
  73. data/spec/fixtures/sample_service/result_select_products_name_price.xml +92 -0
  74. data/spec/property_metadata_spec.rb +10 -10
  75. data/spec/query_builder_spec.rb +153 -14
  76. data/spec/revised_service_spec.rb +111 -6
  77. data/spec/service_spec.rb +389 -85
  78. data/spec/spec_helper.rb +3 -0
  79. data/spec/support/sample_service_matcher.rb +15 -0
  80. data/test/RubyODataService/RubyODataService/App_Data/.gitkeep +0 -0
  81. data/test/blueprints.rb +15 -9
  82. data/test/usage_samples/querying.rb +5 -1
  83. data/test/usage_samples/sample_data.rb +1 -3
  84. metadata +276 -76
  85. data/CHANGELOG.rdoc +0 -88
  86. data/README.rdoc +0 -259
data/Rakefile CHANGED
@@ -1,14 +1,7 @@
1
- require 'rake/rdoctask'
2
1
  require 'bundler'
3
2
  require 'rspec/core/rake_task'
4
3
  require 'cucumber/rake/task'
5
4
 
6
- Rake::RDocTask.new do |rd|
7
- rd.main = "README.rdoc"
8
- rd.rdoc_files.include("README.rdoc", "CHANGELOG.rdoc", "lib/**/*.rb")
9
- rd.rdoc_dir = 'doc'
10
- end
11
-
12
5
  desc "Run specs"
13
6
  RSpec::Core::RakeTask.new do |t|
14
7
  t.pattern = "./spec/**/*_spec.rb" # don't need this, it's default.
@@ -20,6 +13,23 @@ Cucumber::Rake::Task.new(:features) do |t|
20
13
  t.cucumber_opts = "features --format progress"
21
14
  end
22
15
 
23
-
24
16
  Bundler::GemHelper.install_tasks
25
- task :default => [:spec, :features]
17
+ task :default => [:spec, :features]
18
+
19
+ desc "Run with code coverage"
20
+ task :coverage do
21
+ ENV['COVERAGE'] = 'true' if Gem::Version.new(RUBY_VERSION) > Gem::Version.new('1.9')
22
+
23
+ Rake::Task["spec"].execute
24
+ Rake::Task["features"].execute
25
+ end
26
+
27
+ desc "Run test with coveralls"
28
+ task :test_with_coveralls => [:coverage, 'coveralls_push_workaround']
29
+ task :coveralls_push_workaround do
30
+ if Gem::Version.new(RUBY_VERSION) > Gem::Version.new('1.9')
31
+ require 'coveralls/rake/task'
32
+ Coveralls::RakeTask.new
33
+ Rake::Task["coveralls:push"].invoke
34
+ end
35
+ end
@@ -1,5 +1,6 @@
1
+ @basic_auth
1
2
  Feature: Service Should Access Basic Auth Protected Resources
2
-
3
+
3
4
  Background:
4
5
  Given a HTTP BasicAuth ODataService exists using username "admin" and password "passwd"
5
6
  And blueprints exist for the service
@@ -11,7 +12,7 @@ Scenario: Entity should fill values on protected resource
11
12
  Given I call "AddToCategories" on the service with a new "Category" object with Name: "Auth Test Category"
12
13
  And I save changes
13
14
  And I call "Categories" on the service with args: "1"
14
- When I run the query
15
+ When I run the query within a cassette named "basic_auth_protected_resource"
15
16
  Then the method "Id" on the first result should equal: "1"
16
17
  And the method "Name" on the first result should equal: "Auth Test Category"
17
18
 
@@ -1,8 +1,9 @@
1
+ @batch_request
1
2
  Feature: Batch request
2
3
  In order to minimize network traffic
3
4
  As a user of the library
4
5
  I want to be able to batch changes (Add/Update/Delete) and persist the batch instead of one at a time
5
-
6
+
6
7
  Background:
7
8
  Given a HTTP ODataService exists
8
9
  And blueprints exist for the service
@@ -14,7 +15,7 @@ Scenario: Save Changes should allow for batch additions
14
15
  Then the save result should equal: "true"
15
16
  When I call "Products" on the service
16
17
  And I order by: "Name"
17
- And I run the query
18
+ And I run the query within a cassette named "batch_request_additions"
18
19
  Then the result should be:
19
20
  | Name |
20
21
  | Product 1 |
@@ -31,13 +32,13 @@ Scenario: Save Changes should allow for batch updates
31
32
  And I call "update_object" on the service with the first last query result
32
33
  When I call "Products" on the service
33
34
  And I filter the query with: "Name eq 'Product 2'"
34
- And I run the query
35
+ And I run the query
35
36
  And I set "Name" on the first result to "Product 2 - Updated"
36
37
  And I call "update_object" on the service with the first last query result
37
38
  When I save changes
38
39
  When I call "Products" on the service
39
40
  And I order by: "Name"
40
- And I run the query
41
+ And I run the query within a cassette named "batch_request_updates"
41
42
  Then the result should be:
42
43
  | Name |
43
44
  | Product 1 - Updated |
@@ -55,12 +56,12 @@ Scenario: Save Changes should allow for batch deletes
55
56
  And I call "delete_object" on the service with the first last query result
56
57
  When I call "Products" on the service
57
58
  And I filter the query with: "Name eq 'Product 3'"
58
- And I run the query
59
+ And I run the query
59
60
  And I call "delete_object" on the service with the first last query result
60
61
  When I save changes
61
62
  When I call "Products" on the service
62
63
  And I order by: "Name"
63
- And I run the query
64
+ And I run the query within a cassette named "batch_request_deletes"
64
65
  Then the result should be:
65
66
  | Name |
66
67
  | Product 1 |
@@ -0,0 +1,57 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://admin:passwd@win7dev:8989/SampleService/BasicAuth/RubyOData.svc/Categories(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
+ - '1270'
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=zpifmralioi4qiwd0lg0uqcq; 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
+ - Sat, 11 Aug 2012 21:36:29 GMT
41
+ body:
42
+ encoding: US-ASCII
43
+ string: <?xml version="1.0" encoding="utf-8"?><entry xml:base="http://win7dev:8989/SampleService/BasicAuth/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/BasicAuth/RubyOData.svc/Categories(1)</id><category
47
+ term="RubyODataService.Category" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"
48
+ /><link rel="edit" title="Category" href="Categories(1)" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Products"
49
+ type="application/atom+xml;type=feed" title="Products" href="Categories(1)/Products"
50
+ /><title /><updated>2012-08-11T21:36:30Z</updated><author><name /></author><content
51
+ type="application/xml"><m:properties><d:Id m:type="Edm.Int32">1</d:Id><d:Name>Auth
52
+ Test Category</d:Name><d:AuditFields m:type="RubyODataService.AuditFields"><d:CreateDate
53
+ m:type="Edm.DateTime">2012-08-11T21:36:30.453</d:CreateDate><d:ModifiedDate
54
+ m:type="Edm.DateTime">2012-08-11T21:36:30.453</d:ModifiedDate><d:CreatedBy>Machinist</d:CreatedBy></d:AuditFields></m:properties></content></entry>
55
+ http_version: !!null
56
+ recorded_at: Sat, 11 Aug 2012 21:36:30 GMT
57
+ recorded_with: VCR 2.2.4
@@ -0,0 +1,69 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://win7dev:8989/SampleService/RubyOData.svc/Products?$orderby=Name
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
+ - '2706'
25
+ Content-Type:
26
+ - application/atom+xml;type=feed;charset=utf-8
27
+ Server:
28
+ - Microsoft-IIS/7.5
29
+ Set-Cookie:
30
+ - ASP.NET_SessionId=f4m0q12lgd4twvpgowaich4j; 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:43:14 GMT
41
+ body:
42
+ encoding: US-ASCII
43
+ string: <?xml version="1.0" encoding="utf-8"?><feed 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</id><title
47
+ type="text">Products</title><updated>2012-08-07T21:43:15Z</updated><link rel="self"
48
+ title="Products" href="Products" /><entry><id>http://win7dev:8989/SampleService/RubyOData.svc/Products(1)</id><category
49
+ term="RubyODataService.Product" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"
50
+ /><link rel="edit" title="Product" href="Products(1)" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Category"
51
+ type="application/atom+xml;type=entry" title="Category" href="Products(1)/Category"
52
+ /><title /><updated>2012-08-07T21:43:15Z</updated><author><name /></author><content
53
+ type="application/xml"><m:properties><d:Id m:type="Edm.Int32">1</d:Id><d:Name>Product
54
+ 1</d:Name><d:Description>Test Widget</d:Description><d:Price m:type="Edm.Decimal">50.00</d:Price><d:DiscontinuedDate
55
+ m:type="Edm.DateTime" m:null="true" /><d:CategoryId m:type="Edm.Int32">1</d:CategoryId><d:AuditFields
56
+ m:type="RubyODataService.AuditFields"><d:CreateDate m:type="Edm.DateTime">2012-08-07T21:43:14.983</d:CreateDate><d:ModifiedDate
57
+ m:type="Edm.DateTime">2012-08-07T21:43:14.983</d:ModifiedDate><d:CreatedBy>Machinist</d:CreatedBy></d:AuditFields></m:properties></content></entry><entry><id>http://win7dev:8989/SampleService/RubyOData.svc/Products(2)</id><category
58
+ term="RubyODataService.Product" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"
59
+ /><link rel="edit" title="Product" href="Products(2)" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Category"
60
+ type="application/atom+xml;type=entry" title="Category" href="Products(2)/Category"
61
+ /><title /><updated>2012-08-07T21:43:15Z</updated><author><name /></author><content
62
+ type="application/xml"><m:properties><d:Id m:type="Edm.Int32">2</d:Id><d:Name>Product
63
+ 2</d:Name><d:Description>Test Widget</d:Description><d:Price m:type="Edm.Decimal">25.00</d:Price><d:DiscontinuedDate
64
+ m:type="Edm.DateTime" m:null="true" /><d:CategoryId m:type="Edm.Int32">2</d:CategoryId><d:AuditFields
65
+ m:type="RubyODataService.AuditFields"><d:CreateDate m:type="Edm.DateTime">2012-08-07T21:43:14.983</d:CreateDate><d:ModifiedDate
66
+ m:type="Edm.DateTime">2012-08-07T21:43:14.983</d:ModifiedDate><d:CreatedBy>Machinist</d:CreatedBy></d:AuditFields></m:properties></content></entry></feed>
67
+ http_version: !!null
68
+ recorded_at: Tue, 07 Aug 2012 21:43:14 GMT
69
+ recorded_with: VCR 2.2.4
@@ -0,0 +1,69 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://win7dev:8989/SampleService/RubyOData.svc/Products?$orderby=Name
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
+ - '2702'
25
+ Content-Type:
26
+ - application/atom+xml;type=feed;charset=utf-8
27
+ Server:
28
+ - Microsoft-IIS/7.5
29
+ Set-Cookie:
30
+ - ASP.NET_SessionId=qafny5qbazxvbtg3q0znew3e; 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:43:15 GMT
41
+ body:
42
+ encoding: US-ASCII
43
+ string: <?xml version="1.0" encoding="utf-8"?><feed 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</id><title
47
+ type="text">Products</title><updated>2012-08-07T21:43:16Z</updated><link rel="self"
48
+ title="Products" href="Products" /><entry><id>http://win7dev:8989/SampleService/RubyOData.svc/Products(1)</id><category
49
+ term="RubyODataService.Product" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"
50
+ /><link rel="edit" title="Product" href="Products(1)" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Category"
51
+ type="application/atom+xml;type=entry" title="Category" href="Products(1)/Category"
52
+ /><title /><updated>2012-08-07T21:43:16Z</updated><author><name /></author><content
53
+ type="application/xml"><m:properties><d:Id m:type="Edm.Int32">1</d:Id><d:Name>Product
54
+ 1</d:Name><d:Description>Test Widget</d:Description><d:Price m:type="Edm.Decimal">50.00</d:Price><d:DiscontinuedDate
55
+ m:type="Edm.DateTime" m:null="true" /><d:CategoryId m:type="Edm.Int32">1</d:CategoryId><d:AuditFields
56
+ m:type="RubyODataService.AuditFields"><d:CreateDate m:type="Edm.DateTime">2012-08-07T21:43:16.11</d:CreateDate><d:ModifiedDate
57
+ m:type="Edm.DateTime">2012-08-07T21:43:16.11</d:ModifiedDate><d:CreatedBy>Machinist</d:CreatedBy></d:AuditFields></m:properties></content></entry><entry><id>http://win7dev:8989/SampleService/RubyOData.svc/Products(4)</id><category
58
+ term="RubyODataService.Product" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"
59
+ /><link rel="edit" title="Product" href="Products(4)" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Category"
60
+ type="application/atom+xml;type=entry" title="Category" href="Products(4)/Category"
61
+ /><title /><updated>2012-08-07T21:43:16Z</updated><author><name /></author><content
62
+ type="application/xml"><m:properties><d:Id m:type="Edm.Int32">4</d:Id><d:Name>Product
63
+ 4</d:Name><d:Description>Test Widget</d:Description><d:Price m:type="Edm.Decimal">75.50</d:Price><d:DiscontinuedDate
64
+ m:type="Edm.DateTime" m:null="true" /><d:CategoryId m:type="Edm.Int32">4</d:CategoryId><d:AuditFields
65
+ m:type="RubyODataService.AuditFields"><d:CreateDate m:type="Edm.DateTime">2012-08-07T21:43:16.11</d:CreateDate><d:ModifiedDate
66
+ m:type="Edm.DateTime">2012-08-07T21:43:16.11</d:ModifiedDate><d:CreatedBy>Machinist</d:CreatedBy></d:AuditFields></m:properties></content></entry></feed>
67
+ http_version: !!null
68
+ recorded_at: Tue, 07 Aug 2012 21:43:16 GMT
69
+ recorded_with: VCR 2.2.4
@@ -0,0 +1,69 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://win7dev:8989/SampleService/RubyOData.svc/Products?$orderby=Name
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
+ - '2728'
25
+ Content-Type:
26
+ - application/atom+xml;type=feed;charset=utf-8
27
+ Server:
28
+ - Microsoft-IIS/7.5
29
+ Set-Cookie:
30
+ - ASP.NET_SessionId=xbi0rweg5uqzhtmxau31f0my; 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:43:15 GMT
41
+ body:
42
+ encoding: US-ASCII
43
+ string: <?xml version="1.0" encoding="utf-8"?><feed 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</id><title
47
+ type="text">Products</title><updated>2012-08-07T21:43:15Z</updated><link rel="self"
48
+ title="Products" href="Products" /><entry><id>http://win7dev:8989/SampleService/RubyOData.svc/Products(1)</id><category
49
+ term="RubyODataService.Product" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"
50
+ /><link rel="edit" title="Product" href="Products(1)" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Category"
51
+ type="application/atom+xml;type=entry" title="Category" href="Products(1)/Category"
52
+ /><title /><updated>2012-08-07T21:43:15Z</updated><author><name /></author><content
53
+ type="application/xml"><m:properties><d:Id m:type="Edm.Int32">1</d:Id><d:Name>Product
54
+ 1 - Updated</d:Name><d:Description>Test Widget</d:Description><d:Price m:type="Edm.Decimal">100.00</d:Price><d:DiscontinuedDate
55
+ m:type="Edm.DateTime" m:null="true" /><d:CategoryId m:type="Edm.Int32">1</d:CategoryId><d:AuditFields
56
+ m:type="RubyODataService.AuditFields"><d:CreateDate m:type="Edm.DateTime">2012-08-07T21:43:15.453</d:CreateDate><d:ModifiedDate
57
+ m:type="Edm.DateTime">2012-08-07T21:43:15.453</d:ModifiedDate><d:CreatedBy>Machinist</d:CreatedBy></d:AuditFields></m:properties></content></entry><entry><id>http://win7dev:8989/SampleService/RubyOData.svc/Products(2)</id><category
58
+ term="RubyODataService.Product" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"
59
+ /><link rel="edit" title="Product" href="Products(2)" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Category"
60
+ type="application/atom+xml;type=entry" title="Category" href="Products(2)/Category"
61
+ /><title /><updated>2012-08-07T21:43:15Z</updated><author><name /></author><content
62
+ type="application/xml"><m:properties><d:Id m:type="Edm.Int32">2</d:Id><d:Name>Product
63
+ 2 - Updated</d:Name><d:Description>Test Widget</d:Description><d:Price m:type="Edm.Decimal">100.00</d:Price><d:DiscontinuedDate
64
+ m:type="Edm.DateTime" m:null="true" /><d:CategoryId m:type="Edm.Int32">2</d:CategoryId><d:AuditFields
65
+ m:type="RubyODataService.AuditFields"><d:CreateDate m:type="Edm.DateTime">2012-08-07T21:43:15.453</d:CreateDate><d:ModifiedDate
66
+ m:type="Edm.DateTime">2012-08-07T21:43:15.453</d:ModifiedDate><d:CreatedBy>Machinist</d:CreatedBy></d:AuditFields></m:properties></content></entry></feed>
67
+ http_version: !!null
68
+ recorded_at: Tue, 07 Aug 2012 21:43:15 GMT
69
+ recorded_with: VCR 2.2.4
@@ -0,0 +1,46 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: http://win7dev:8989/SampleService/RubyOData.svc/CleanDatabaseForTesting
6
+ body:
7
+ encoding: ASCII-8BIT
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - ! '*/*; q=0.5, application/xml'
12
+ Accept-Encoding:
13
+ - gzip, deflate
14
+ Content-Length:
15
+ - '0'
16
+ Content-Type:
17
+ - application/x-www-form-urlencoded
18
+ User-Agent:
19
+ - Ruby
20
+ response:
21
+ status:
22
+ code: 204
23
+ message: No Content
24
+ headers:
25
+ Cache-Control:
26
+ - no-cache
27
+ Server:
28
+ - Microsoft-IIS/7.5
29
+ Set-Cookie:
30
+ - ASP.NET_SessionId=o4ege2gplbuvzbgrt4ij0bku; 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:39 GMT
41
+ body:
42
+ encoding: US-ASCII
43
+ string: ''
44
+ http_version: !!null
45
+ recorded_at: Tue, 07 Aug 2012 21:47:40 GMT
46
+ recorded_with: VCR 2.2.4
@@ -0,0 +1,297 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: http://admin:passwd@win7dev:8989/SampleService/BasicAuth/RubyOData.svc/Categories
6
+ body:
7
+ encoding: ASCII-8BIT
8
+ string: ! '{"Name":"Auth Test Category","AuditFields":{"CreatedBy":"Machinist"}}'
9
+ headers:
10
+ Accept:
11
+ - ! '*/*; q=0.5, application/xml'
12
+ Accept-Encoding:
13
+ - gzip, deflate
14
+ Content-Type:
15
+ - application/json
16
+ Content-Length:
17
+ - '69'
18
+ User-Agent:
19
+ - Ruby
20
+ response:
21
+ status:
22
+ code: 201
23
+ message: Created
24
+ headers:
25
+ Cache-Control:
26
+ - no-cache
27
+ Content-Length:
28
+ - '1278'
29
+ Content-Type:
30
+ - application/atom+xml;type=entry;charset=utf-8
31
+ Location:
32
+ - http://win7dev:8989/SampleService/BasicAuth/RubyOData.svc/Categories(1)
33
+ Server:
34
+ - Microsoft-IIS/7.5
35
+ Set-Cookie:
36
+ - ASP.NET_SessionId=b5h3vo0kbga5mdcgu2nfisos; path=/; HttpOnly
37
+ X-Content-Type-Options:
38
+ - nosniff
39
+ Dataserviceversion:
40
+ - 1.0;
41
+ X-Aspnet-Version:
42
+ - 4.0.30319
43
+ X-Powered-By:
44
+ - ASP.NET
45
+ Date:
46
+ - Tue, 07 Aug 2012 21:21:24 GMT
47
+ body:
48
+ encoding: US-ASCII
49
+ string: <?xml version="1.0" encoding="utf-8"?><entry xml:base="http://win7dev:8989/SampleService/BasicAuth/RubyOData.svc/"
50
+ xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices"
51
+ xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:georss="http://www.georss.org/georss"
52
+ xmlns:gml="http://www.opengis.net/gml"><id>http://win7dev:8989/SampleService/BasicAuth/RubyOData.svc/Categories(1)</id><category
53
+ term="RubyODataService.Category" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"
54
+ /><link rel="edit" title="Category" href="Categories(1)" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Products"
55
+ type="application/atom+xml;type=feed" title="Products" href="Categories(1)/Products"
56
+ /><title /><updated>2012-08-07T21:21:25Z</updated><author><name /></author><content
57
+ type="application/xml"><m:properties><d:Id m:type="Edm.Int32">1</d:Id><d:Name>Auth
58
+ Test Category</d:Name><d:AuditFields m:type="RubyODataService.AuditFields"><d:CreateDate
59
+ m:type="Edm.DateTime">2012-08-07T21:21:25.296875Z</d:CreateDate><d:ModifiedDate
60
+ m:type="Edm.DateTime">2012-08-07T21:21:25.296875Z</d:ModifiedDate><d:CreatedBy>Machinist</d:CreatedBy></d:AuditFields></m:properties></content></entry>
61
+ http_version: !!null
62
+ recorded_at: Tue, 07 Aug 2012 21:21:25 GMT
63
+ - request:
64
+ method: get
65
+ uri: http://admin:passwd@win7dev:8989/SampleService/BasicAuth/RubyOData.svc/Categories(1)
66
+ body:
67
+ encoding: US-ASCII
68
+ string: ''
69
+ headers:
70
+ Accept:
71
+ - ! '*/*; q=0.5, application/xml'
72
+ Accept-Encoding:
73
+ - gzip, deflate
74
+ User-Agent:
75
+ - Ruby
76
+ response:
77
+ status:
78
+ code: 200
79
+ message: OK
80
+ headers:
81
+ Cache-Control:
82
+ - no-cache
83
+ Content-Length:
84
+ - '1270'
85
+ Content-Type:
86
+ - application/atom+xml;type=entry;charset=utf-8
87
+ Server:
88
+ - Microsoft-IIS/7.5
89
+ Set-Cookie:
90
+ - ASP.NET_SessionId=vqh02cwip2bvnmgt4smeb5ok; path=/; HttpOnly
91
+ X-Content-Type-Options:
92
+ - nosniff
93
+ Dataserviceversion:
94
+ - 1.0;
95
+ X-Aspnet-Version:
96
+ - 4.0.30319
97
+ X-Powered-By:
98
+ - ASP.NET
99
+ Date:
100
+ - Tue, 07 Aug 2012 21:21:24 GMT
101
+ body:
102
+ encoding: US-ASCII
103
+ string: <?xml version="1.0" encoding="utf-8"?><entry xml:base="http://win7dev:8989/SampleService/BasicAuth/RubyOData.svc/"
104
+ xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices"
105
+ xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:georss="http://www.georss.org/georss"
106
+ xmlns:gml="http://www.opengis.net/gml"><id>http://win7dev:8989/SampleService/BasicAuth/RubyOData.svc/Categories(1)</id><category
107
+ term="RubyODataService.Category" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"
108
+ /><link rel="edit" title="Category" href="Categories(1)" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Products"
109
+ type="application/atom+xml;type=feed" title="Products" href="Categories(1)/Products"
110
+ /><title /><updated>2012-08-07T21:21:25Z</updated><author><name /></author><content
111
+ type="application/xml"><m:properties><d:Id m:type="Edm.Int32">1</d:Id><d:Name>Auth
112
+ Test Category</d:Name><d:AuditFields m:type="RubyODataService.AuditFields"><d:CreateDate
113
+ m:type="Edm.DateTime">2012-08-07T21:21:25.297</d:CreateDate><d:ModifiedDate
114
+ m:type="Edm.DateTime">2012-08-07T21:21:25.297</d:ModifiedDate><d:CreatedBy>Machinist</d:CreatedBy></d:AuditFields></m:properties></content></entry>
115
+ http_version: !!null
116
+ recorded_at: Tue, 07 Aug 2012 21:21:25 GMT
117
+ - request:
118
+ method: get
119
+ uri: http://admin:bad_pwd@win7dev:8989/SampleService/BasicAuth/RubyOData.svc/$metadata
120
+ body:
121
+ encoding: US-ASCII
122
+ string: ''
123
+ headers:
124
+ Accept:
125
+ - ! '*/*; q=0.5, application/xml'
126
+ Accept-Encoding:
127
+ - gzip, deflate
128
+ User-Agent:
129
+ - Ruby
130
+ response:
131
+ status:
132
+ code: 401
133
+ message: Unauthorized
134
+ headers:
135
+ Content-Type:
136
+ - text/html
137
+ Server:
138
+ - Microsoft-IIS/7.5
139
+ Www-Authenticate:
140
+ - Basic
141
+ X-Powered-By:
142
+ - ASP.NET
143
+ Date:
144
+ - Tue, 07 Aug 2012 21:21:24 GMT
145
+ Content-Length:
146
+ - '1218'
147
+ body:
148
+ encoding: US-ASCII
149
+ string: ! "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\r\n<html
150
+ xmlns=\"http://www.w3.org/1999/xhtml\">\r\n<head>\r\n<title>401 - Unauthorized:
151
+ Access is denied due to invalid credentials.</title>\r\n<style type=\"text/css\">\r\n<!--\r\nbody{margin:0;font-size:.7em;font-family:Verdana,
152
+ Arial, Helvetica, sans-serif;background:#EEEEEE;}\r\nfieldset{padding:0 15px
153
+ 10px 15px;} \r\nh1{font-size:2.4em;margin:0;color:#FFF;}\r\nh2{font-size:1.7em;margin:0;color:#CC0000;}
154
+ \r\nh3{font-size:1.2em;margin:10px 0 0 0;color:#000000;} \r\n#header{width:96%;margin:0
155
+ 0 0 0;padding:6px 2% 6px 2%;font-family:\"trebuchet MS\", Verdana, sans-serif;color:#FFF;\r\nbackground-color:#555555;}\r\n#content{margin:0
156
+ 0 0 2%;position:relative;}\r\n.content-container{background:#FFF;width:96%;margin-top:8px;padding:10px;position:relative;}\r\n-->\r\n</style>\r\n</head>\r\n<body>\r\n<div
157
+ id=\"header\"><h1>Server Error</h1></div>\r\n<div id=\"content\">\r\n <div
158
+ class=\"content-container\"><fieldset>\r\n <h2>401 - Unauthorized: Access
159
+ is denied due to invalid credentials.</h2>\r\n <h3>You do not have permission
160
+ to view this directory or page using the credentials that you supplied.</h3>\r\n
161
+ </fieldset></div>\r\n</div>\r\n</body>\r\n</html>\r\n"
162
+ http_version: !!null
163
+ recorded_at: Tue, 07 Aug 2012 21:21:25 GMT
164
+ - request:
165
+ method: get
166
+ uri: http://admin:passwd@win7dev:8989/SampleService/BasicAuth/RubyOData.svc/$metadata
167
+ body:
168
+ encoding: US-ASCII
169
+ string: ''
170
+ headers:
171
+ Accept:
172
+ - ! '*/*; q=0.5, application/xml'
173
+ Accept-Encoding:
174
+ - gzip, deflate
175
+ User-Agent:
176
+ - Ruby
177
+ response:
178
+ status:
179
+ code: 200
180
+ message: OK
181
+ headers:
182
+ Cache-Control:
183
+ - no-cache
184
+ Content-Length:
185
+ - '4055'
186
+ Content-Type:
187
+ - application/xml;charset=utf-8
188
+ Server:
189
+ - Microsoft-IIS/7.5
190
+ Set-Cookie:
191
+ - ASP.NET_SessionId=qdj1en0bcagvrdhule4xjvxg; path=/; HttpOnly
192
+ X-Content-Type-Options:
193
+ - nosniff
194
+ Dataserviceversion:
195
+ - 1.0;
196
+ X-Aspnet-Version:
197
+ - 4.0.30319
198
+ X-Powered-By:
199
+ - ASP.NET
200
+ Date:
201
+ - Tue, 07 Aug 2012 21:21:24 GMT
202
+ body:
203
+ encoding: US-ASCII
204
+ 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
205
+ m:DataServiceVersion="1.0" m:MaxDataServiceVersion="3.0" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"><Schema
206
+ Namespace="RubyODataService" xmlns="http://schemas.microsoft.com/ado/2008/09/edm"><EntityType
207
+ Name="Product"><Key><PropertyRef Name="Id" /></Key><Property Name="Id" Type="Edm.Int32"
208
+ Nullable="false" p6:StoreGeneratedPattern="Identity" xmlns:p6="http://schemas.microsoft.com/ado/2009/02/edm/annotation"
209
+ /><Property Name="Name" Type="Edm.String" MaxLength="4000" FixedLength="false"
210
+ Unicode="true" /><Property Name="Description" Type="Edm.String" MaxLength="4000"
211
+ FixedLength="false" Unicode="true" /><Property Name="Price" Type="Edm.Decimal"
212
+ Nullable="false" Precision="18" Scale="2" /><Property Name="DiscontinuedDate"
213
+ Type="Edm.DateTime" /><Property Name="CategoryId" Type="Edm.Int32" Nullable="false"
214
+ /><Property Name="AuditFields" Type="RubyODataService.AuditFields" Nullable="false"
215
+ /><NavigationProperty Name="Category" Relationship="RubyODataService.Category_Products"
216
+ ToRole="Category_Products_Source" FromRole="Category_Products_Target" /></EntityType><ComplexType
217
+ Name="AuditFields"><Property Name="CreateDate" Type="Edm.DateTime" Nullable="false"
218
+ /><Property Name="ModifiedDate" Type="Edm.DateTime" Nullable="false" /><Property
219
+ Name="CreatedBy" Type="Edm.String" MaxLength="4000" FixedLength="false" Unicode="true"
220
+ /></ComplexType><EntityType Name="Category"><Key><PropertyRef Name="Id" /></Key><Property
221
+ Name="Id" Type="Edm.Int32" Nullable="false" p6:StoreGeneratedPattern="Identity"
222
+ xmlns:p6="http://schemas.microsoft.com/ado/2009/02/edm/annotation" /><Property
223
+ Name="Name" Type="Edm.String" MaxLength="4000" FixedLength="false" Unicode="true"
224
+ /><Property Name="AuditFields" Type="RubyODataService.AuditFields" Nullable="false"
225
+ /><NavigationProperty Name="Products" Relationship="RubyODataService.Category_Products"
226
+ ToRole="Category_Products_Target" FromRole="Category_Products_Source" /></EntityType><EntityType
227
+ Name="EdmMetadata"><Key><PropertyRef Name="Id" /></Key><Property Name="Id"
228
+ Type="Edm.Int32" Nullable="false" p6:StoreGeneratedPattern="Identity" xmlns:p6="http://schemas.microsoft.com/ado/2009/02/edm/annotation"
229
+ /><Property Name="ModelHash" Type="Edm.String" MaxLength="4000" FixedLength="false"
230
+ Unicode="true" /></EntityType><Association Name="Category_Products"><End Type="RubyODataService.Product"
231
+ Role="Category_Products_Target" Multiplicity="*" /><End Type="RubyODataService.Category"
232
+ Role="Category_Products_Source" Multiplicity="1"><OnDelete Action="Cascade"
233
+ /></End><ReferentialConstraint><Principal Role="Category_Products_Source"><PropertyRef
234
+ Name="Id" /></Principal><Dependent Role="Category_Products_Target"><PropertyRef
235
+ Name="CategoryId" /></Dependent></ReferentialConstraint></Association><EntityContainer
236
+ Name="RubyODataContext" m:IsDefaultEntityContainer="true"><EntitySet Name="Products"
237
+ EntityType="RubyODataService.Product" /><EntitySet Name="Categories" EntityType="RubyODataService.Category"
238
+ /><EntitySet Name="EdmMetadatas" EntityType="RubyODataService.EdmMetadata"
239
+ /><AssociationSet Name="Category_Products" Association="RubyODataService.Category_Products"><End
240
+ Role="Category_Products_Target" EntitySet="Products" /><End Role="Category_Products_Source"
241
+ EntitySet="Categories" /></AssociationSet><FunctionImport Name="CleanDatabaseForTesting"
242
+ m:HttpMethod="POST" /><FunctionImport Name="EntityCategoryWebGet" ReturnType="Collection(RubyODataService.Category)"
243
+ EntitySet="Categories" m:HttpMethod="GET" /><FunctionImport Name="CategoryNames"
244
+ ReturnType="Collection(Edm.String)" m:HttpMethod="GET" /><FunctionImport Name="FirstCategoryId"
245
+ ReturnType="Edm.Int32" m:HttpMethod="GET" /><FunctionImport Name="EntitySingleCategoryWebGet"
246
+ ReturnType="RubyODataService.Category" EntitySet="Categories" m:HttpMethod="GET"><Parameter
247
+ Name="id" Type="Edm.Int32" /></FunctionImport></EntityContainer></Schema></edmx:DataServices></edmx:Edmx>
248
+ http_version: !!null
249
+ recorded_at: Tue, 07 Aug 2012 21:21:25 GMT
250
+ - request:
251
+ method: get
252
+ uri: http://win7dev:8989/SampleService/BasicAuth/RubyOData.svc/$metadata
253
+ body:
254
+ encoding: US-ASCII
255
+ string: ''
256
+ headers:
257
+ Accept:
258
+ - ! '*/*; q=0.5, application/xml'
259
+ Accept-Encoding:
260
+ - gzip, deflate
261
+ User-Agent:
262
+ - Ruby
263
+ response:
264
+ status:
265
+ code: 401
266
+ message: Unauthorized
267
+ headers:
268
+ Content-Type:
269
+ - text/html
270
+ Server:
271
+ - Microsoft-IIS/7.5
272
+ Www-Authenticate:
273
+ - Basic
274
+ X-Powered-By:
275
+ - ASP.NET
276
+ Date:
277
+ - Tue, 07 Aug 2012 21:21:24 GMT
278
+ Content-Length:
279
+ - '1218'
280
+ body:
281
+ encoding: US-ASCII
282
+ string: ! "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\r\n<html
283
+ xmlns=\"http://www.w3.org/1999/xhtml\">\r\n<head>\r\n<title>401 - Unauthorized:
284
+ Access is denied due to invalid credentials.</title>\r\n<style type=\"text/css\">\r\n<!--\r\nbody{margin:0;font-size:.7em;font-family:Verdana,
285
+ Arial, Helvetica, sans-serif;background:#EEEEEE;}\r\nfieldset{padding:0 15px
286
+ 10px 15px;} \r\nh1{font-size:2.4em;margin:0;color:#FFF;}\r\nh2{font-size:1.7em;margin:0;color:#CC0000;}
287
+ \r\nh3{font-size:1.2em;margin:10px 0 0 0;color:#000000;} \r\n#header{width:96%;margin:0
288
+ 0 0 0;padding:6px 2% 6px 2%;font-family:\"trebuchet MS\", Verdana, sans-serif;color:#FFF;\r\nbackground-color:#555555;}\r\n#content{margin:0
289
+ 0 0 2%;position:relative;}\r\n.content-container{background:#FFF;width:96%;margin-top:8px;padding:10px;position:relative;}\r\n-->\r\n</style>\r\n</head>\r\n<body>\r\n<div
290
+ id=\"header\"><h1>Server Error</h1></div>\r\n<div id=\"content\">\r\n <div
291
+ class=\"content-container\"><fieldset>\r\n <h2>401 - Unauthorized: Access
292
+ is denied due to invalid credentials.</h2>\r\n <h3>You do not have permission
293
+ to view this directory or page using the credentials that you supplied.</h3>\r\n
294
+ </fieldset></div>\r\n</div>\r\n</body>\r\n</html>\r\n"
295
+ http_version: !!null
296
+ recorded_at: Tue, 07 Aug 2012 21:21:25 GMT
297
+ recorded_with: VCR 2.2.4