lti_skydrive 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (120) hide show
  1. checksums.yaml +8 -8
  2. data/Rakefile +20 -1
  3. data/app/assets/javascripts/skydrive/bundle.js +1792 -1794
  4. data/app/controllers/skydrive/application_controller.rb +1 -1
  5. data/app/controllers/skydrive/files_controller.rb +0 -5
  6. data/app/controllers/skydrive/launch_controller.rb +69 -19
  7. data/app/controllers/skydrive/session_controller.rb +1 -1
  8. data/app/models/skydrive/token.rb +1 -3
  9. data/app/models/skydrive/user.rb +18 -0
  10. data/app/views/layouts/skydrive/application.html.erb +0 -1
  11. data/app/views/skydrive/launch/app_redirect.html.erb +1 -1
  12. data/app/views/skydrive/launch/launch_error.html.erb +4 -0
  13. data/config/initializers/sharepoint.rb +2 -1
  14. data/config/routes.rb +1 -0
  15. data/lib/skydrive/client.rb +62 -29
  16. data/lib/skydrive/file.rb +1 -1
  17. data/lib/skydrive/raven_logger.rb +16 -0
  18. data/lib/skydrive/version.rb +1 -1
  19. data/spec/controllers/launch_controller_spec.rb +209 -0
  20. data/spec/lib/skydrive/client_spec.rb +185 -0
  21. data/spec/lib/skydrive/file_spec.rb +63 -0
  22. data/spec/lib/skydrive/folder_spec.rb +19 -0
  23. data/spec/models/api_key_spec.rb +21 -0
  24. data/spec/spec_helper.rb +49 -0
  25. data/{test/dummy → spec/test_app}/README.rdoc +0 -0
  26. data/{test/dummy → spec/test_app}/Rakefile +1 -1
  27. data/{test/dummy → spec/test_app}/app/assets/javascripts/application.js +0 -0
  28. data/{test/dummy → spec/test_app}/app/assets/stylesheets/application.css +0 -0
  29. data/{test/dummy → spec/test_app}/app/controllers/application_controller.rb +0 -0
  30. data/{test/dummy → spec/test_app}/app/helpers/application_helper.rb +0 -0
  31. data/{test/dummy → spec/test_app}/app/views/layouts/application.html.erb +1 -1
  32. data/{test/dummy → spec/test_app}/bin/bundle +0 -0
  33. data/{test/dummy → spec/test_app}/bin/rails +0 -0
  34. data/{test/dummy → spec/test_app}/bin/rake +0 -0
  35. data/{test/dummy → spec/test_app}/config/application.rb +7 -15
  36. data/{test/dummy → spec/test_app}/config/boot.rb +1 -1
  37. data/{test/dummy → spec/test_app}/config/database.yml +8 -8
  38. data/{test/dummy → spec/test_app}/config/environment.rb +1 -1
  39. data/{test/dummy → spec/test_app}/config/environments/development.rb +1 -1
  40. data/{test/dummy → spec/test_app}/config/environments/production.rb +2 -2
  41. data/{test/dummy → spec/test_app}/config/environments/test.rb +1 -1
  42. data/{test/dummy → spec/test_app}/config/initializers/backtrace_silencers.rb +0 -0
  43. data/{test/dummy → spec/test_app}/config/initializers/filter_parameter_logging.rb +0 -0
  44. data/{test/dummy → spec/test_app}/config/initializers/inflections.rb +0 -0
  45. data/{test/dummy → spec/test_app}/config/initializers/mime_types.rb +0 -0
  46. data/{test/dummy → spec/test_app}/config/initializers/secret_token.rb +1 -1
  47. data/spec/test_app/config/initializers/session_store.rb +3 -0
  48. data/{test/dummy → spec/test_app}/config/initializers/wrap_parameters.rb +0 -0
  49. data/{test/dummy → spec/test_app}/config/routes.rb +0 -0
  50. data/spec/test_app/config/sharepoint.yml +17 -0
  51. data/{test/dummy → spec/test_app}/config.ru +0 -0
  52. data/{test/dummy → spec/test_app}/db/schema.rb +0 -1
  53. data/{test/dummy → spec/test_app}/public/404.html +0 -0
  54. data/{test/dummy → spec/test_app}/public/422.html +0 -0
  55. data/{test/dummy → spec/test_app}/public/500.html +0 -0
  56. data/spec/test_app/public/assets/application-710416f2f225dfabdc1644964d73bb6e.js +14 -0
  57. data/spec/test_app/public/assets/application-f83fdeca1df44ae142d477b21c557b7b.css +14 -0
  58. data/spec/test_app/public/assets/bootstrap/glyphicons-halflings-regular-0658df48a6185a0d17acc3f86ff2073b.svg +229 -0
  59. data/spec/test_app/public/assets/bootstrap/glyphicons-halflings-regular-0c86ed38ad91a73661c05f22fed185b3.woff +0 -0
  60. data/spec/test_app/public/assets/bootstrap/glyphicons-halflings-regular-b4268224f45a1b3e5575b458b0f68636.ttf +0 -0
  61. data/spec/test_app/public/assets/bootstrap/glyphicons-halflings-regular-bb146793ac4efa4609bb0512921fc8f2.eot +0 -0
  62. data/spec/test_app/public/assets/lti_box_engine/application-e4115e9d7a64091d8e938ebe100de7b8.js +20 -0
  63. data/spec/test_app/public/assets/lti_box_engine/banner-cc541d8b706841c4c101e20c54f57cd7.png +0 -0
  64. data/spec/test_app/public/assets/lti_box_engine/icon-f4a2da1d67a72ae4962d0152d0b25d0d.png +0 -0
  65. data/{test/dummy → spec/test_app}/public/favicon.ico +0 -0
  66. metadata +98 -170
  67. data/test/controllers/skydrive/ember_controller_test.rb +0 -11
  68. data/test/dummy/config/initializers/session_store.rb +0 -3
  69. data/test/dummy/config/locales/en.yml +0 -23
  70. data/test/dummy/config/sharepoint.yml +0 -31
  71. data/test/dummy/db/development.sqlite3 +0 -0
  72. data/test/dummy/log/development.log +0 -47831
  73. data/test/dummy/tmp/cache/assets/development/sprockets/007f0b35cdfe0e199e160ca7d8c6549f +0 -0
  74. data/test/dummy/tmp/cache/assets/development/sprockets/10c0e5e7b23b9f05226f908616b8f740 +0 -0
  75. data/test/dummy/tmp/cache/assets/development/sprockets/17ae7f285d886e07f4db626a659963f8 +0 -0
  76. data/test/dummy/tmp/cache/assets/development/sprockets/18e08230de276dd3238e77cf0826189c +0 -0
  77. data/test/dummy/tmp/cache/assets/development/sprockets/1a88e6194e0de973583e2adefdc5ac18 +0 -0
  78. data/test/dummy/tmp/cache/assets/development/sprockets/1fc004bfb36f4c31a590a840e552a5c9 +0 -0
  79. data/test/dummy/tmp/cache/assets/development/sprockets/2e4c5fbbf5bf02ef9bd200cce7a7ebc1 +0 -0
  80. data/test/dummy/tmp/cache/assets/development/sprockets/358b2efd0a896115b444b609bc46fca1 +0 -0
  81. data/test/dummy/tmp/cache/assets/development/sprockets/3d9987487f81715791eeeed72ad127da +0 -0
  82. data/test/dummy/tmp/cache/assets/development/sprockets/430f864d22195be98702ac04bc5343b8 +0 -0
  83. data/test/dummy/tmp/cache/assets/development/sprockets/432817256836b657a99d2c2b8afb82bf +0 -0
  84. data/test/dummy/tmp/cache/assets/development/sprockets/45f9e6cdd4d120d901099ccb2018fb4f +0 -0
  85. data/test/dummy/tmp/cache/assets/development/sprockets/5186e21495c07e70e882425df200732c +0 -0
  86. data/test/dummy/tmp/cache/assets/development/sprockets/53de95b978e9c09ae4d2300888e937e5 +0 -0
  87. data/test/dummy/tmp/cache/assets/development/sprockets/5dc21d3b55fc9ca8fbf6582c7fac6c44 +0 -0
  88. data/test/dummy/tmp/cache/assets/development/sprockets/5dd770bdd24bc838e0604eaf2e1d62e0 +0 -0
  89. data/test/dummy/tmp/cache/assets/development/sprockets/5ed30435bc197334c5c942a45ad637d8 +0 -0
  90. data/test/dummy/tmp/cache/assets/development/sprockets/62ef3761af670019ed9f926b6893f7b7 +0 -0
  91. data/test/dummy/tmp/cache/assets/development/sprockets/74283c36e06317a57bf88c444c66eabe +0 -0
  92. data/test/dummy/tmp/cache/assets/development/sprockets/7edc3f1ebc1331bb170f75ee2ce227b1 +0 -0
  93. data/test/dummy/tmp/cache/assets/development/sprockets/88b8a5c8da15ecfa6e7154a661b242a6 +0 -0
  94. data/test/dummy/tmp/cache/assets/development/sprockets/8b73f393f902dcdfe3dd05afb0f5e2d1 +0 -0
  95. data/test/dummy/tmp/cache/assets/development/sprockets/9531ae5356e65c245a5f006c8dd1c577 +0 -0
  96. data/test/dummy/tmp/cache/assets/development/sprockets/98060297d706705e3fc0f7857857dbb9 +0 -0
  97. data/test/dummy/tmp/cache/assets/development/sprockets/98871292949834ebaa9e1eebdd3dca4f +0 -0
  98. data/test/dummy/tmp/cache/assets/development/sprockets/9e208aeff46e060cb20a25456d6be611 +0 -0
  99. data/test/dummy/tmp/cache/assets/development/sprockets/9ebc8e4abeebfae73c59c391e49d0172 +0 -0
  100. data/test/dummy/tmp/cache/assets/development/sprockets/a082682acbe6ed53f5b69ec4d6b336a4 +0 -0
  101. data/test/dummy/tmp/cache/assets/development/sprockets/a7cec1f4ecd136cb80122e121cb63b01 +0 -0
  102. data/test/dummy/tmp/cache/assets/development/sprockets/aa4851494096d3890157afaad27cc407 +0 -0
  103. data/test/dummy/tmp/cache/assets/development/sprockets/ab90d34dfc192bf5fc19836906a3dc23 +0 -0
  104. data/test/dummy/tmp/cache/assets/development/sprockets/afcc3340d4944bf68dd319f3b59c3237 +0 -0
  105. data/test/dummy/tmp/cache/assets/development/sprockets/b0728e2ff6ca4e7f91dbeff31978a9c9 +0 -0
  106. data/test/dummy/tmp/cache/assets/development/sprockets/b54c3c599c3ca4b4f26aa9df12514a56 +0 -0
  107. data/test/dummy/tmp/cache/assets/development/sprockets/b7a1dd5c7d3c2aca0f451fcbc5737cb8 +0 -0
  108. data/test/dummy/tmp/cache/assets/development/sprockets/b83d0d640ae485682db0dff00a1ef7d8 +0 -0
  109. data/test/dummy/tmp/cache/assets/development/sprockets/bcaf1a8e8073121541dcae50e896db44 +0 -0
  110. data/test/dummy/tmp/cache/assets/development/sprockets/be723463abbc85ed29cf5a5840fbfed0 +0 -0
  111. data/test/dummy/tmp/cache/assets/development/sprockets/c16ddf1297328a121de46d0ce47df069 +0 -0
  112. data/test/dummy/tmp/cache/assets/development/sprockets/ccc62e82e5e329c6af0ccf81402ac838 +0 -0
  113. data/test/dummy/tmp/cache/assets/development/sprockets/d47464809e089dba588360f9f0a59d50 +0 -0
  114. data/test/dummy/tmp/cache/assets/development/sprockets/d9044923a28026f1c6540cebecebb7e0 +0 -0
  115. data/test/dummy/tmp/cache/assets/development/sprockets/deacdc0b128cd87d3275fed230cbb7d5 +0 -0
  116. data/test/dummy/tmp/cache/assets/development/sprockets/fbbc449abae90cbd209354c203662388 +0 -0
  117. data/test/helpers/skydrive/ember_helper_test.rb +0 -6
  118. data/test/integration/navigation_test.rb +0 -10
  119. data/test/skydrive_test.rb +0 -7
  120. data/test/test_helper.rb +0 -15
@@ -0,0 +1,185 @@
1
+ require 'spec_helper'
2
+
3
+ describe Skydrive::Client do
4
+ before(:each) do
5
+ @client = Skydrive::Client.new(
6
+ client_domain: "test.skydrive.com",
7
+ personal_url: "https://personal.skydrive.com",
8
+ client_id: "test"
9
+ )
10
+ end
11
+
12
+ it "should initialize" do
13
+ opts = {
14
+ client_id: 'id',
15
+ client_secret: 'secret',
16
+ guid: 'asdfjkl',
17
+ token: 'ABCDE',
18
+ random_garbage: 'bar'
19
+ }
20
+ client = Skydrive::Client.new(opts);
21
+ expect(client.client_id).to eq(opts[:client_id])
22
+ expect(client.client_secret).to eq(opts[:client_secret])
23
+ expect(client.guid).to eq(opts[:guid])
24
+ expect(client.token).to eq(opts[:token])
25
+ expect(client.respond_to?(:random_garbage)).to be false
26
+ end
27
+
28
+ it "#oauth_authorize_redirect_uri" do
29
+ redirect_uri = "http://localhost/auth/redirect"
30
+ state = "abcde-overly-simplified-state"
31
+ redir = @client.oauth_authorize_redirect_uri(redirect_uri, { state: state })
32
+ expect(redir).to include("state=#{state}")
33
+ end
34
+
35
+ it "#refresh_token" do
36
+ stub_request(:post, "https://login.windows.net/common/oauth2/token").
37
+ with(:body => {"client_id"=>"test", "client_secret"=>"", "grant_type"=>"refresh_token", "refresh_token"=>"", "resource"=>"NEW_TOKEN"},
38
+ :headers => {'Accept'=>'*/*; q=0.5, application/xml', 'Accept-Encoding'=>'gzip, deflate', 'Content-Length'=>'88', 'Content-Type'=>'application/x-www-form-urlencoded', 'User-Agent'=>'Ruby'}).
39
+ to_return(:status => 200,
40
+ :body => "{\"token_type\":\"Bearer\",\"access_token\":\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\",\"expires_in\":\"43199\",\"not_before\":\"1389210441\",\"expires_on\":\"1389253641\",\"resource\":\"00000003-0000-0ff1-ce00-000000000000/instructure-my.sharepoint.com@4b13a608-c248-4bd1-9017-2794c0d7e5c5\"}",
41
+ :headers => {
42
+ :cache_control=>"no-cache, no-store",
43
+ :pragma=>"no-cache",
44
+ :content_type=>"application/json; charset=utf-8",
45
+ :expires=>"-1",
46
+ :request_id=>"8fa6a09a-354a-4710-8650-e9095e70f8f8",
47
+ :x_content_type_options=>"nosniff",
48
+ :date=>"Wed, 08 Jan 2014 19:47:20 GMT",
49
+ :content_length=>"1183"
50
+ })
51
+
52
+ results = @client.refresh_token(resource: "NEW_TOKEN")
53
+ expect(results['access_token']).to eq('ABCDEFGHIJKLMNOPQRSTUVWXYZ')
54
+ WebMock.reset!
55
+ end
56
+
57
+ it "#format_results" do
58
+ prev_tz = ENV['TZ']
59
+ ENV['TZ'] = 'UTC'
60
+
61
+ raw_results = "{\"token_type\":\"Bearer\",\"access_token\":\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\",\"expires_in\":\"43199\",\"not_before\":\"1389210441\",\"expires_on\":\"1389253641\",\"resource\":\"00000003-0000-0ff1-ce00-000000000000/instructure-my.sharepoint.com@4b13a608-c248-4bd1-9017-2794c0d7e5c5\"}"
62
+ results = JSON.parse(raw_results)
63
+ modified_results = @client.format_results(results)
64
+ expect(modified_results['expires_in']).to be(43199)
65
+ expect(modified_results['not_before'].to_s).to eq("2014-01-08 19:47:21 +0000")
66
+ expect(modified_results['expires_on'].to_s).to eq("2014-01-09 07:47:21 +0000")
67
+ ENV['TZ'] = prev_tz
68
+ end
69
+
70
+ it "#get_realm" do
71
+ returned_realm = "4xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
72
+ stub_request(:get, "https://personal.skydrive.com/_vti_bin/client.svc/").
73
+ with(:headers => {'Accept'=>'*/*; q=0.5, application/xml', 'Accept-Encoding'=>'gzip, deflate', 'Authorization'=>'Bearer', 'User-Agent'=>'Ruby'}).
74
+ to_return(:status => 200, :body => "", :headers => { :www_authenticate => "Bearer realm=\"#{returned_realm}\",client_id=\"00000003-0000-0ff1-ce00-000000000000\",trusted_issuers=\"00000001-0000-0000-c000-000000000000@*,https://sts.windows.net/*/,00000003-0000-0ff1-ce00-000000000000@90140122-8516-11e1-8eff-49304924019b\"" })
75
+ realm = @client.get_realm
76
+ expect(realm).to eq(returned_realm)
77
+ WebMock.reset!
78
+ end
79
+
80
+ it "#get_folder_and_files" do
81
+ uri1 = "https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/Lists(guid'85208d43-a3be-43ca-a737-f6913578427b')/RootFolder"
82
+ data1 = {"__metadata"=>{"id"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFolderByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents')", "uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFolderByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents')", "type"=>"SP.Folder"}, "Files"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFolderByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents')/Files"}}, "ListItemAllFields"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFolderByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents')/ListItemAllFields"}}, "ParentFolder"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFolderByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents')/ParentFolder"}}, "Properties"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFolderByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents')/Properties"}}, "Folders"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFolderByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents')/Folders"}}, "ItemCount"=>13, "Name"=>"Documents", "ServerRelativeUrl"=>"/personal/ericb_instructure_onmicrosoft_com/Documents", "WelcomePage"=>""}
83
+ uri2 = "https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFolderByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents')/Files"
84
+ data2 = {"results"=>[{"__metadata"=>{"id"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/2013-05-17_1633.png')", "uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/2013-05-17_1633.png')", "type"=>"SP.File"}, "Author"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/2013-05-17_1633.png')/Author"}}, "CheckedOutByUser"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/2013-05-17_1633.png')/CheckedOutByUser"}}, "ListItemAllFields"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/2013-05-17_1633.png')/ListItemAllFields"}}, "LockedByUser"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/2013-05-17_1633.png')/LockedByUser"}}, "ModifiedBy"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/2013-05-17_1633.png')/ModifiedBy"}}, "Versions"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/2013-05-17_1633.png')/Versions"}}, "CheckInComment"=>"", "CheckOutType"=>2, "ContentTag"=>"{2BD61768-5A77-417D-B16E-1002D414F2F3},1,2", "CustomizedPageStatus"=>0, "ETag"=>"\"{2BD61768-5A77-417D-B16E-1002D414F2F3},1\"", "Exists"=>true, "Length"=>"166006", "Level"=>1, "MajorVersion"=>1, "MinorVersion"=>0, "Name"=>"2013-05-17_1633.png", "ServerRelativeUrl"=>"/personal/ericb_instructure_onmicrosoft_com/Documents/2013-05-17_1633.png", "TimeCreated"=>"2013-07-29T20:09:09Z", "TimeLastModified"=>"2013-07-29T20:09:09Z", "Title"=>nil, "UIVersion"=>512, "UIVersionLabel"=>"1.0", "UniqueId"=>"2bd61768-5a77-417d-b16e-1002d414f2f3"}, {"__metadata"=>{"id"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/ember-edit-link.png')", "uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/ember-edit-link.png')", "type"=>"SP.File"}, "Author"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/ember-edit-link.png')/Author"}}, "CheckedOutByUser"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/ember-edit-link.png')/CheckedOutByUser"}}, "ListItemAllFields"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/ember-edit-link.png')/ListItemAllFields"}}, "LockedByUser"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/ember-edit-link.png')/LockedByUser"}}, "ModifiedBy"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/ember-edit-link.png')/ModifiedBy"}}, "Versions"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/ember-edit-link.png')/Versions"}}, "CheckInComment"=>"", "CheckOutType"=>2, "ContentTag"=>"{A3B70BED-6038-4C6D-A505-211A0941ACF2},1,2", "CustomizedPageStatus"=>0, "ETag"=>"\"{A3B70BED-6038-4C6D-A505-211A0941ACF2},1\"", "Exists"=>true, "Length"=>"312184", "Level"=>1, "MajorVersion"=>1, "MinorVersion"=>0, "Name"=>"ember-edit-link.png", "ServerRelativeUrl"=>"/personal/ericb_instructure_onmicrosoft_com/Documents/ember-edit-link.png", "TimeCreated"=>"2013-07-29T20:09:08Z", "TimeLastModified"=>"2013-07-29T20:09:08Z", "Title"=>nil, "UIVersion"=>512, "UIVersionLabel"=>"1.0", "UniqueId"=>"a3b70bed-6038-4c6d-a505-211a0941acf2"}, {"__metadata"=>{"id"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/UtahJS-Logo.eps')", "uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/UtahJS-Logo.eps')", "type"=>"SP.File"}, "Author"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/UtahJS-Logo.eps')/Author"}}, "CheckedOutByUser"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/UtahJS-Logo.eps')/CheckedOutByUser"}}, "ListItemAllFields"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/UtahJS-Logo.eps')/ListItemAllFields"}}, "LockedByUser"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/UtahJS-Logo.eps')/LockedByUser"}}, "ModifiedBy"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/UtahJS-Logo.eps')/ModifiedBy"}}, "Versions"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/UtahJS-Logo.eps')/Versions"}}, "CheckInComment"=>"", "CheckOutType"=>2, "ContentTag"=>"{21F6FE98-A05D-4221-9DB2-28F0D6227223},1,1", "CustomizedPageStatus"=>0, "ETag"=>"\"{21F6FE98-A05D-4221-9DB2-28F0D6227223},1\"", "Exists"=>true, "Length"=>"423139", "Level"=>1, "MajorVersion"=>1, "MinorVersion"=>0, "Name"=>"UtahJS-Logo.eps", "ServerRelativeUrl"=>"/personal/ericb_instructure_onmicrosoft_com/Documents/UtahJS-Logo.eps", "TimeCreated"=>"2013-07-22T21:03:02Z", "TimeLastModified"=>"2013-07-22T21:03:02Z", "Title"=>nil, "UIVersion"=>512, "UIVersionLabel"=>"1.0", "UniqueId"=>"21f6fe98-a05d-4221-9db2-28f0d6227223"}, {"__metadata"=>{"id"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/Aloha Loyalty Web Service Implementers Guide.doc')", "uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/Aloha%20Loyalty%20Web%20Service%20Implementers%20Guide.doc')", "type"=>"SP.File"}, "Author"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/Aloha%20Loyalty%20Web%20Service%20Implementers%20Guide.doc')/Author"}}, "CheckedOutByUser"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/Aloha%20Loyalty%20Web%20Service%20Implementers%20Guide.doc')/CheckedOutByUser"}}, "ListItemAllFields"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/Aloha%20Loyalty%20Web%20Service%20Implementers%20Guide.doc')/ListItemAllFields"}}, "LockedByUser"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/Aloha%20Loyalty%20Web%20Service%20Implementers%20Guide.doc')/LockedByUser"}}, "ModifiedBy"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/Aloha%20Loyalty%20Web%20Service%20Implementers%20Guide.doc')/ModifiedBy"}}, "Versions"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/Aloha%20Loyalty%20Web%20Service%20Implementers%20Guide.doc')/Versions"}}, "CheckInComment"=>"", "CheckOutType"=>2, "ContentTag"=>"{089FC417-D07E-4300-BA64-312889E176D0},1,1", "CustomizedPageStatus"=>0, "ETag"=>"\"{089FC417-D07E-4300-BA64-312889E176D0},1\"", "Exists"=>true, "Length"=>"673792", "Level"=>1, "MajorVersion"=>1, "MinorVersion"=>0, "Name"=>"Aloha Loyalty Web Service Implementers Guide.doc", "ServerRelativeUrl"=>"/personal/ericb_instructure_onmicrosoft_com/Documents/Aloha Loyalty Web Service Implementers Guide.doc", "TimeCreated"=>"2013-07-29T20:09:58Z", "TimeLastModified"=>"2013-07-29T20:09:58Z", "Title"=>"REQ 48382 User-defined Drilldowns", "UIVersion"=>512, "UIVersionLabel"=>"1.0", "UniqueId"=>"089fc417-d07e-4300-ba64-312889e176d0"}, {"__metadata"=>{"id"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/11 - Marry Me.mp3')", "uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/11%20-%20Marry%20Me.mp3')", "type"=>"SP.File"}, "Author"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/11%20-%20Marry%20Me.mp3')/Author"}}, "CheckedOutByUser"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/11%20-%20Marry%20Me.mp3')/CheckedOutByUser"}}, "ListItemAllFields"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/11%20-%20Marry%20Me.mp3')/ListItemAllFields"}}, "LockedByUser"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/11%20-%20Marry%20Me.mp3')/LockedByUser"}}, "ModifiedBy"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/11%20-%20Marry%20Me.mp3')/ModifiedBy"}}, "Versions"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/11%20-%20Marry%20Me.mp3')/Versions"}}, "CheckInComment"=>"", "CheckOutType"=>2, "ContentTag"=>"{CEF6DDAE-10FD-442D-98C7-3C42DDFA3D58},1,1", "CustomizedPageStatus"=>0, "ETag"=>"\"{CEF6DDAE-10FD-442D-98C7-3C42DDFA3D58},1\"", "Exists"=>true, "Length"=>"6153728", "Level"=>1, "MajorVersion"=>1, "MinorVersion"=>0, "Name"=>"11 - Marry Me.mp3", "ServerRelativeUrl"=>"/personal/ericb_instructure_onmicrosoft_com/Documents/11 - Marry Me.mp3", "TimeCreated"=>"2013-07-29T20:09:53Z", "TimeLastModified"=>"2013-07-29T20:09:53Z", "Title"=>nil, "UIVersion"=>512, "UIVersionLabel"=>"1.0", "UniqueId"=>"cef6ddae-10fd-442d-98c7-3c42ddfa3d58"}, {"__metadata"=>{"id"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/TerryMooreTranscript04042013.pdf')", "uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/TerryMooreTranscript04042013.pdf')", "type"=>"SP.File"}, "Author"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/TerryMooreTranscript04042013.pdf')/Author"}}, "CheckedOutByUser"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/TerryMooreTranscript04042013.pdf')/CheckedOutByUser"}}, "ListItemAllFields"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/TerryMooreTranscript04042013.pdf')/ListItemAllFields"}}, "LockedByUser"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/TerryMooreTranscript04042013.pdf')/LockedByUser"}}, "ModifiedBy"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/TerryMooreTranscript04042013.pdf')/ModifiedBy"}}, "Versions"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/TerryMooreTranscript04042013.pdf')/Versions"}}, "CheckInComment"=>"", "CheckOutType"=>2, "ContentTag"=>"{D8331D51-E13E-49F9-BF70-47F6E0D3A308},1,1", "CustomizedPageStatus"=>0, "ETag"=>"\"{D8331D51-E13E-49F9-BF70-47F6E0D3A308},1\"", "Exists"=>true, "Length"=>"294536", "Level"=>1, "MajorVersion"=>1, "MinorVersion"=>0, "Name"=>"TerryMooreTranscript04042013.pdf", "ServerRelativeUrl"=>"/personal/ericb_instructure_onmicrosoft_com/Documents/TerryMooreTranscript04042013.pdf", "TimeCreated"=>"2013-07-22T21:03:19Z", "TimeLastModified"=>"2013-07-22T21:03:19Z", "Title"=>nil, "UIVersion"=>512, "UIVersionLabel"=>"1.0", "UniqueId"=>"d8331d51-e13e-49f9-bf70-47f6e0d3a308"}, {"__metadata"=>{"id"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/footer-links.png')", "uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/footer-links.png')", "type"=>"SP.File"}, "Author"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/footer-links.png')/Author"}}, "CheckedOutByUser"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/footer-links.png')/CheckedOutByUser"}}, "ListItemAllFields"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/footer-links.png')/ListItemAllFields"}}, "LockedByUser"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/footer-links.png')/LockedByUser"}}, "ModifiedBy"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/footer-links.png')/ModifiedBy"}}, "Versions"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/footer-links.png')/Versions"}}, "CheckInComment"=>"", "CheckOutType"=>2, "ContentTag"=>"{709AB6B9-BD72-4E5C-AE0E-50C1AD7D5037},1,2", "CustomizedPageStatus"=>0, "ETag"=>"\"{709AB6B9-BD72-4E5C-AE0E-50C1AD7D5037},1\"", "Exists"=>true, "Length"=>"795", "Level"=>1, "MajorVersion"=>1, "MinorVersion"=>0, "Name"=>"footer-links.png", "ServerRelativeUrl"=>"/personal/ericb_instructure_onmicrosoft_com/Documents/footer-links.png", "TimeCreated"=>"2013-07-29T20:09:09Z", "TimeLastModified"=>"2013-07-29T20:09:09Z", "Title"=>nil, "UIVersion"=>512, "UIVersionLabel"=>"1.0", "UniqueId"=>"709ab6b9-bd72-4e5c-ae0e-50c1ad7d5037"}, {"__metadata"=>{"id"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/Employee Perks.gdoc')", "uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/Employee%20Perks.gdoc')", "type"=>"SP.File"}, "Author"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/Employee%20Perks.gdoc')/Author"}}, "CheckedOutByUser"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/Employee%20Perks.gdoc')/CheckedOutByUser"}}, "ListItemAllFields"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/Employee%20Perks.gdoc')/ListItemAllFields"}}, "LockedByUser"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/Employee%20Perks.gdoc')/LockedByUser"}}, "ModifiedBy"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/Employee%20Perks.gdoc')/ModifiedBy"}}, "Versions"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/Employee%20Perks.gdoc')/Versions"}}, "CheckInComment"=>"", "CheckOutType"=>2, "ContentTag"=>"{DBC6ABF7-4094-4C20-BA5F-57FB01B2435A},1,1", "CustomizedPageStatus"=>0, "ETag"=>"\"{DBC6ABF7-4094-4C20-BA5F-57FB01B2435A},1\"", "Exists"=>true, "Length"=>"167", "Level"=>1, "MajorVersion"=>1, "MinorVersion"=>0, "Name"=>"Employee Perks.gdoc", "ServerRelativeUrl"=>"/personal/ericb_instructure_onmicrosoft_com/Documents/Employee Perks.gdoc", "TimeCreated"=>"2013-07-29T20:10:04Z", "TimeLastModified"=>"2013-07-29T20:10:04Z", "Title"=>nil, "UIVersion"=>512, "UIVersionLabel"=>"1.0", "UniqueId"=>"dbc6abf7-4094-4c20-ba5f-57fb01b2435a"}, {"__metadata"=>{"id"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/epf-0.1.3.zip')", "uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/epf-0.1.3.zip')", "type"=>"SP.File"}, "Author"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/epf-0.1.3.zip')/Author"}}, "CheckedOutByUser"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/epf-0.1.3.zip')/CheckedOutByUser"}}, "ListItemAllFields"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/epf-0.1.3.zip')/ListItemAllFields"}}, "LockedByUser"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/epf-0.1.3.zip')/LockedByUser"}}, "ModifiedBy"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/epf-0.1.3.zip')/ModifiedBy"}}, "Versions"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/epf-0.1.3.zip')/Versions"}}, "CheckInComment"=>"", "CheckOutType"=>2, "ContentTag"=>"{7DA44B8D-F822-45D0-AD09-8ACCB664FCC8},1,1", "CustomizedPageStatus"=>0, "ETag"=>"\"{7DA44B8D-F822-45D0-AD09-8ACCB664FCC8},1\"", "Exists"=>true, "Length"=>"148060", "Level"=>1, "MajorVersion"=>1, "MinorVersion"=>0, "Name"=>"epf-0.1.3.zip", "ServerRelativeUrl"=>"/personal/ericb_instructure_onmicrosoft_com/Documents/epf-0.1.3.zip", "TimeCreated"=>"2013-07-29T20:10:30Z", "TimeLastModified"=>"2013-07-29T20:10:30Z", "Title"=>nil, "UIVersion"=>512, "UIVersionLabel"=>"1.0", "UniqueId"=>"7da44b8d-f822-45d0-ad09-8accb664fcc8"}, {"__metadata"=>{"id"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/2013-05-19_2016.png')", "uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/2013-05-19_2016.png')", "type"=>"SP.File"}, "Author"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/2013-05-19_2016.png')/Author"}}, "CheckedOutByUser"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/2013-05-19_2016.png')/CheckedOutByUser"}}, "ListItemAllFields"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/2013-05-19_2016.png')/ListItemAllFields"}}, "LockedByUser"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/2013-05-19_2016.png')/LockedByUser"}}, "ModifiedBy"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/2013-05-19_2016.png')/ModifiedBy"}}, "Versions"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/2013-05-19_2016.png')/Versions"}}, "CheckInComment"=>"", "CheckOutType"=>2, "ContentTag"=>"{50ADB549-08C3-411C-ACAC-9EA5898E1D15},1,2", "CustomizedPageStatus"=>0, "ETag"=>"\"{50ADB549-08C3-411C-ACAC-9EA5898E1D15},1\"", "Exists"=>true, "Length"=>"300096", "Level"=>1, "MajorVersion"=>1, "MinorVersion"=>0, "Name"=>"2013-05-19_2016.png", "ServerRelativeUrl"=>"/personal/ericb_instructure_onmicrosoft_com/Documents/2013-05-19_2016.png", "TimeCreated"=>"2013-07-29T20:09:09Z", "TimeLastModified"=>"2013-07-29T20:09:09Z", "Title"=>nil, "UIVersion"=>512, "UIVersionLabel"=>"1.0", "UniqueId"=>"50adb549-08c3-411c-acac-9ea5898e1d15"}, {"__metadata"=>{"id"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/course_activity_1362094997.csv')", "uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/course_activity_1362094997.csv')", "type"=>"SP.File"}, "Author"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/course_activity_1362094997.csv')/Author"}}, "CheckedOutByUser"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/course_activity_1362094997.csv')/CheckedOutByUser"}}, "ListItemAllFields"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/course_activity_1362094997.csv')/ListItemAllFields"}}, "LockedByUser"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/course_activity_1362094997.csv')/LockedByUser"}}, "ModifiedBy"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/course_activity_1362094997.csv')/ModifiedBy"}}, "Versions"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFileByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/course_activity_1362094997.csv')/Versions"}}, "CheckInComment"=>"", "CheckOutType"=>2, "ContentTag"=>"{25B9F17B-7BD5-4AFF-9E72-F68A11105962},1,1", "CustomizedPageStatus"=>0, "ETag"=>"\"{25B9F17B-7BD5-4AFF-9E72-F68A11105962},1\"", "Exists"=>true, "Length"=>"2582", "Level"=>1, "MajorVersion"=>1, "MinorVersion"=>0, "Name"=>"course_activity_1362094997.csv", "ServerRelativeUrl"=>"/personal/ericb_instructure_onmicrosoft_com/Documents/course_activity_1362094997.csv", "TimeCreated"=>"2013-07-29T20:10:22Z", "TimeLastModified"=>"2013-07-29T20:10:22Z", "Title"=>nil, "UIVersion"=>512, "UIVersionLabel"=>"1.0", "UniqueId"=>"25b9f17b-7bd5-4aff-9e72-f68a11105962"}]}
85
+ uri3 = "https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFolderByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents')/Folders"
86
+ data3 = {"results"=>[{"__metadata"=>{"id"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFolderByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/Pictures')", "uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFolderByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/Pictures')", "type"=>"SP.Folder"}, "Files"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFolderByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/Pictures')/Files"}}, "ListItemAllFields"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFolderByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/Pictures')/ListItemAllFields"}}, "ParentFolder"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFolderByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/Pictures')/ParentFolder"}}, "Properties"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFolderByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/Pictures')/Properties"}}, "Folders"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFolderByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/Pictures')/Folders"}}, "ItemCount"=>5, "Name"=>"Pictures", "ServerRelativeUrl"=>"/personal/ericb_instructure_onmicrosoft_com/Documents/Pictures", "WelcomePage"=>""}, {"__metadata"=>{"id"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFolderByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/Shared with Everyone')", "uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFolderByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/Shared%20with%20Everyone')", "type"=>"SP.Folder"}, "Files"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFolderByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/Shared%20with%20Everyone')/Files"}}, "ListItemAllFields"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFolderByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/Shared%20with%20Everyone')/ListItemAllFields"}}, "ParentFolder"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFolderByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/Shared%20with%20Everyone')/ParentFolder"}}, "Properties"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFolderByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/Shared%20with%20Everyone')/Properties"}}, "Folders"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFolderByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/Shared%20with%20Everyone')/Folders"}}, "ItemCount"=>2, "Name"=>"Shared with Everyone", "ServerRelativeUrl"=>"/personal/ericb_instructure_onmicrosoft_com/Documents/Shared with Everyone", "WelcomePage"=>""}, {"__metadata"=>{"id"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFolderByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/Forms')", "uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFolderByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/Forms')", "type"=>"SP.Folder"}, "Files"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFolderByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/Forms')/Files"}}, "ListItemAllFields"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFolderByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/Forms')/ListItemAllFields"}}, "ParentFolder"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFolderByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/Forms')/ParentFolder"}}, "Properties"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFolderByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/Forms')/Properties"}}, "Folders"=>{"__deferred"=>{"uri"=>"https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/GetFolderByServerRelativeUrl('/personal/ericb_instructure_onmicrosoft_com/Documents/Forms')/Folders"}}, "ItemCount"=>0, "Name"=>"Forms", "ServerRelativeUrl"=>"/personal/ericb_instructure_onmicrosoft_com/Documents/Forms", "WelcomePage"=>""}]}
87
+ allow_any_instance_of(Skydrive::Client).to receive(:api_call).with(uri1).and_return(data1)
88
+ allow_any_instance_of(Skydrive::Client).to receive(:api_call).with(uri2).and_return(data2)
89
+ allow_any_instance_of(Skydrive::Client).to receive(:api_call).with(uri3).and_return(data3)
90
+ results = @client.get_folder_and_files(uri1)
91
+
92
+ expect(results.files.length).to be(11)
93
+ file_names = results.files.map(&:name)
94
+ expect(file_names).to include "UtahJS-Logo.eps"
95
+ expect(file_names).to include "footer-links.png"
96
+
97
+ expect(results.folders.length).to eq(2)
98
+ expect(results.folders.map(&:name).sort).to eq(["Pictures", "Shared with Everyone"])
99
+
100
+ WebMock.reset!
101
+ end
102
+
103
+ it "should throw an exception for invalid json" do
104
+ stub_request(:post, "https://login.windows.net/common/oauth2/token").
105
+ with(:body => {"client_id"=>"test", "client_secret"=>"", "grant_type"=>"refresh_token", "refresh_token"=>"", "resource"=>"NEW_TOKEN"},
106
+ :headers => {'Accept'=>'*/*; q=0.5, application/xml', 'Accept-Encoding'=>'gzip, deflate', 'Content-Length'=>'88', 'Content-Type'=>'application/x-www-form-urlencoded', 'User-Agent'=>'Ruby'}).
107
+ to_return(:status => 200,
108
+ :body => "<notjson />",
109
+ :headers => {
110
+ :cache_control=>"no-cache, no-store",
111
+ :pragma=>"no-cache",
112
+ :content_type=>"text/html; charset=utf-8",
113
+ :expires=>"-1",
114
+ :request_id=>"8fa6a09a-354a-4710-8650-e9095e70f8f8",
115
+ :x_content_type_options=>"nosniff",
116
+ :date=>"Wed, 08 Jan 2014 19:47:20 GMT",
117
+ :content_length=>"1183"
118
+ })
119
+
120
+ expect do
121
+ results = @client.refresh_token(resource: "NEW_TOKEN")
122
+ end.to raise_error(JSON::ParserError)
123
+ WebMock.reset!
124
+ end
125
+
126
+ it "should throw an exception for when the json has an error code" do
127
+ stub_request(:post, "https://login.windows.net/common/oauth2/token").
128
+ with(:body => {"client_id"=>"test", "client_secret"=>"", "grant_type"=>"refresh_token", "refresh_token"=>"", "resource"=>"NEW_TOKEN"},
129
+ :headers => {'Accept'=>'*/*; q=0.5, application/xml', 'Accept-Encoding'=>'gzip, deflate', 'Content-Length'=>'88', 'Content-Type'=>'application/x-www-form-urlencoded', 'User-Agent'=>'Ruby'}).
130
+ to_return(:status => 200,
131
+ :body => %q[{
132
+ "error_description" : "AADSTS90014: The request body must contain the following parameter: 'refresh_token'.\r\nTrace ID: 1a18b1f6-e4b2-4129-a1f8-7fa865546c86\r\nCorrelation ID: 4e75524f-f268-499b-b0a2-e3469408748d\r\nTimestamp: 2015-05-01 19:52:25Z",
133
+ "correlation_id" : "4e75524f-f268-499b-b0a2-e3469408748d",
134
+ "error_codes" : [
135
+ 90014
136
+ ],
137
+ "timestamp" : "2015-05-01 19:52:25Z",
138
+ "trace_id" : "1a18b1f6-e4b2-4129-a1f8-7fa865546c86",
139
+ "error" : "invalid_request",
140
+ "context" : null,
141
+ "submit_url" : null
142
+ }],
143
+ :headers => {
144
+ :cache_control=>"no-cache, no-store",
145
+ :pragma=>"no-cache",
146
+ :content_type=>"application/json",
147
+ :expires=>"-1",
148
+ :request_id=>"8fa6a09a-354a-4710-8650-e9095e70f8f8",
149
+ :x_content_type_options=>"nosniff",
150
+ :date=>"Wed, 08 Jan 2014 19:47:20 GMT",
151
+ :content_length=>"1183"
152
+ })
153
+
154
+ expect do
155
+ results = @client.refresh_token(resource: "NEW_TOKEN")
156
+ end.to raise_error(Skydrive::APIResponseErrorException)
157
+ WebMock.reset!
158
+ end
159
+
160
+ it "should throw a special exception weird errors" do
161
+ stub_request(:get, "https://api.office.com/discovery/v1.0/me/services").
162
+ to_return(:status => 401,
163
+ :body => %Q[{
164
+ "error": {
165
+ "code": "-2147024891, System.UnauthorizedAccessException",
166
+ "message": "Access denied. You do not have permission to perform this action or access this resource."
167
+ }
168
+ }],
169
+ :headers => {
170
+ :cache_control=>"no-cache, no-store",
171
+ :pragma=>"no-cache",
172
+ :content_type=>"application/json; charset=utf-8",
173
+ :expires=>"-1",
174
+ :request_id=>"8fa6a09a-354a-4710-8650-e9095e70f8f8",
175
+ :x_content_type_options=>"nosniff",
176
+ :date=>"Wed, 08 Jan 2014 19:47:20 GMT",
177
+ :content_length=>"1183"
178
+ })
179
+
180
+ expect do
181
+ results = @client.get_my_files_service()
182
+ end.to raise_error(Skydrive::APIResponseErrorException)
183
+ WebMock.reset!
184
+ end
185
+ end
@@ -0,0 +1,63 @@
1
+ require 'spec_helper'
2
+
3
+ describe Skydrive::File do
4
+ describe "#update_content_type_data" do
5
+ before(:each) do
6
+ @file = Skydrive::File.new
7
+ end
8
+
9
+ it "when png (and allowed extensions)" do
10
+ @file.name = "test.png"
11
+ @file.update_content_type_data(['doc'])
12
+ expect(@file.icon).to eq("png")
13
+ expect(@file.kind).to eq("PNG image")
14
+ expect(@file.suffix).to eq("png")
15
+ expect(@file.is_embeddable).to be false
16
+ end
17
+
18
+ it "when jpg" do
19
+ @file.name = "test.jpg"
20
+ @file.update_content_type_data
21
+ expect(@file.icon).to eq("jpg")
22
+ expect(@file.kind).to eq("JPEG image")
23
+ expect(@file.suffix).to eq("jpg")
24
+ expect(@file.is_embeddable).to be true
25
+ end
26
+
27
+ it "when bmp" do
28
+ @file.name = "test.bmp"
29
+ @file.update_content_type_data
30
+ expect(@file.icon).to eq("jpg")
31
+ expect(@file.kind).to eq("Windows BMP image")
32
+ expect(@file.suffix).to eq("bmp")
33
+ expect(@file.is_embeddable).to be true
34
+ end
35
+
36
+ it "when doc" do
37
+ @file.name = "test.doc"
38
+ @file.update_content_type_data
39
+ expect(@file.icon).to eq("word")
40
+ expect(@file.kind).to eq("Word document")
41
+ expect(@file.suffix).to eq("doc")
42
+ expect(@file.is_embeddable).to be true
43
+ end
44
+
45
+ it "when pdf" do
46
+ @file.name = "test.pdf"
47
+ @file.update_content_type_data
48
+ expect(@file.icon).to eq("pdf")
49
+ expect(@file.kind).to eq("PDF document")
50
+ expect(@file.suffix).to eq("pdf")
51
+ expect(@file.is_embeddable).to be true
52
+ end
53
+
54
+ it "when unknown" do
55
+ @file.name = "test.unknown"
56
+ @file.update_content_type_data
57
+ expect(@file.icon).to eq("file")
58
+ expect(@file.kind).to eq("")
59
+ expect(@file.suffix).to eq("unknown")
60
+ expect(@file.is_embeddable).to be false
61
+ end
62
+ end
63
+ end
@@ -0,0 +1,19 @@
1
+ require 'spec_helper'
2
+
3
+ describe Skydrive::Folder do
4
+ it "#parse_parent_uri without uri" do
5
+ folder = Skydrive::Folder.new
6
+ folder.server_relative_url = ""
7
+ folder.uri = ""
8
+ folder.parse_parent_uri
9
+ expect(folder.parent_uri).to be_nil
10
+ end
11
+
12
+ it "#parse_parent_uri with uri" do
13
+ folder = Skydrive::Folder.new
14
+ folder.server_relative_url = "/personal/ericb_instructure_onmicrosoft_com/Documents/Pictures/Vacations"
15
+ folder.uri = "https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/Lists(guid'85208d43-a3be-43ca-a737-f6913578427b')/RootFolder"
16
+ folder.parse_parent_uri
17
+ expect(folder.parent_uri[:uri]).to eq("https://instructure-my.sharepoint.com/personal/ericb_instructure_onmicrosoft_com/_api/Web/Lists(guid'85208d43-a3be-43ca-a737-f6913578427b')')")
18
+ end
19
+ end
@@ -0,0 +1,21 @@
1
+ require 'spec_helper'
2
+
3
+ module Skydrive
4
+ describe ApiKey do
5
+ let(:user) {User.create(:email => 'email@email.com', username: 'user', name: 'User')}
6
+ it "creates api keys" do
7
+ api_key = ApiKey.create(scope: 'session', user: user)
8
+ expect(api_key).to_not be_new_record
9
+ expect(api_key.expired_at).to be_a Time
10
+ expect(api_key.oauth_code).to_not be_empty
11
+ end
12
+
13
+ it "trade a code for a token" do
14
+ api_key = ApiKey.create(scope: 'session', user: user)
15
+ expect(ApiKey.trade_oauth_code_for_access_token(api_key.oauth_code)).to eq(api_key)
16
+ api_key.reload
17
+ expect(api_key.oauth_code).to be_nil
18
+ expect(api_key.access_token).to_not be_empty
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,49 @@
1
+ # This file is copied to spec/ when you run 'rails generate rspec:install'
2
+ ENV["RAILS_ENV"] ||= 'test'
3
+ require File.expand_path("../test_app/config/environment", __FILE__)
4
+ require 'rspec/rails'
5
+ require 'webmock/rspec'
6
+
7
+ # Requires supporting ruby files with custom matchers and macros, etc,
8
+ # in spec/support/ and its subdirectories.
9
+ Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
10
+
11
+ # Checks for pending migrations before tests are run.
12
+ # If you are not using ActiveRecord, you can remove this line.
13
+ ActiveRecord::Migration.check_pending! if defined?(ActiveRecord::Migration)
14
+
15
+ RSpec.configure do |config|
16
+ # ## Mock Framework
17
+ #
18
+ # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
19
+ #
20
+ # config.mock_with :mocha
21
+ # config.mock_with :flexmock
22
+ # config.mock_with :rr
23
+ config.mock_with :rspec
24
+
25
+ # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
26
+ config.fixture_path = "#{::Rails.root}/spec/fixtures"
27
+
28
+ # If you're not using ActiveRecord, or you'd prefer not to run each of your
29
+ # examples within a transaction, remove the following line or assign false
30
+ # instead of true.
31
+ config.use_transactional_fixtures = true
32
+
33
+ # If true, the base class of anonymous controllers will be inferred
34
+ # automatically. This will be the default behavior in future versions of
35
+ # rspec-rails.
36
+ config.infer_base_class_for_anonymous_controllers = false
37
+
38
+ # Run specs in random order to surface order dependencies. If you find an
39
+ # order dependency and want to debug it, you can fix the order by providing
40
+ # the seed, which is printed after each run.
41
+ # --seed 1234
42
+ config.order = "random"
43
+ end
44
+
45
+ ActionController::Base.class_eval do
46
+ def perform_action
47
+ perform_action_without_rescue
48
+ end
49
+ end
File without changes
@@ -3,4 +3,4 @@
3
3
 
4
4
  require File.expand_path('../config/application', __FILE__)
5
5
 
6
- Dummy::Application.load_tasks
6
+ TestApp::Application.load_tasks
@@ -1,7 +1,7 @@
1
1
  <!DOCTYPE html>
2
2
  <html>
3
3
  <head>
4
- <title>Dummy</title>
4
+ <title>TestApp</title>
5
5
  <%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %>
6
6
  <%= javascript_include_tag "application", "data-turbolinks-track" => true %>
7
7
  <%= csrf_meta_tags %>
File without changes
File without changes
File without changes
@@ -1,12 +1,16 @@
1
1
  require File.expand_path('../boot', __FILE__)
2
2
 
3
- require 'rails/all'
4
- require 'rack/cors' unless Rails.env.production?
3
+ # Pick the frameworks you want:
4
+ require "active_record/railtie"
5
+ require "action_controller/railtie"
6
+ require "action_mailer/railtie"
7
+ require "sprockets/railtie"
8
+ # require "rails/test_unit/railtie"
5
9
 
6
10
  Bundler.require(*Rails.groups)
7
11
  require "skydrive"
8
12
 
9
- module Dummy
13
+ module TestApp
10
14
  class Application < Rails::Application
11
15
  # Settings in config/environments/* take precedence over those specified here.
12
16
  # Application configuration should go into files in config/initializers
@@ -19,17 +23,5 @@ module Dummy
19
23
  # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
20
24
  # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
21
25
  # config.i18n.default_locale = :de
22
-
23
- config.action_dispatch.default_headers = { 'X-Frame-Options' => 'ALLOWALL' }
24
-
25
- unless Rails.env.production?
26
- config.middleware.insert_before "Rack::Sendfile", "Rack::Cors" do
27
- allow do
28
- origins '*'
29
- resource '*', :headers => :any, :methods => [:get, :post, :options]
30
- end
31
- end
32
- end
33
26
  end
34
27
  end
35
-
@@ -1,5 +1,5 @@
1
1
  # Set up gems listed in the Gemfile.
2
2
  ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__)
3
3
 
4
- require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
4
+ require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
5
5
  $LOAD_PATH.unshift File.expand_path('../../../../lib', __FILE__)
@@ -3,23 +3,23 @@
3
3
  #
4
4
  # Ensure the SQLite 3 gem is defined in your Gemfile
5
5
  # gem 'sqlite3'
6
- development:
6
+ #
7
+ default: &default
7
8
  adapter: sqlite3
8
- database: db/development.sqlite3
9
9
  pool: 5
10
10
  timeout: 5000
11
11
 
12
+ development:
13
+ <<: *default
14
+ database: db/development.sqlite3
15
+
12
16
  # Warning: The database defined as "test" will be erased and
13
17
  # re-generated from your development database when you run "rake".
14
18
  # Do not set this db to the same as development or production.
15
19
  test:
16
- adapter: sqlite3
20
+ <<: *default
17
21
  database: db/test.sqlite3
18
- pool: 5
19
- timeout: 5000
20
22
 
21
23
  production:
22
- adapter: sqlite3
24
+ <<: *default
23
25
  database: db/production.sqlite3
24
- pool: 5
25
- timeout: 5000
@@ -2,4 +2,4 @@
2
2
  require File.expand_path('../application', __FILE__)
3
3
 
4
4
  # Initialize the Rails application.
5
- Dummy::Application.initialize!
5
+ TestApp::Application.initialize!
@@ -1,4 +1,4 @@
1
- Dummy::Application.configure do
1
+ TestApp::Application.configure do
2
2
  # Settings specified here will take precedence over those in config/application.rb.
3
3
 
4
4
  # In the development environment your application's code is reloaded on
@@ -1,4 +1,4 @@
1
- Dummy::Application.configure do
1
+ TestApp::Application.configure do
2
2
  # Settings specified here will take precedence over those in config/application.rb.
3
3
 
4
4
  # Code is not reloaded between requests.
@@ -20,7 +20,7 @@ Dummy::Application.configure do
20
20
  # config.action_dispatch.rack_cache = true
21
21
 
22
22
  # Disable Rails's static asset server (Apache or nginx will already do this).
23
- config.serve_static_assets = true
23
+ config.serve_static_assets = false
24
24
 
25
25
  # Compress JavaScripts and CSS.
26
26
  config.assets.js_compressor = :uglifier
@@ -1,4 +1,4 @@
1
- Dummy::Application.configure do
1
+ TestApp::Application.configure do
2
2
  # Settings specified here will take precedence over those in config/application.rb.
3
3
 
4
4
  # The test environment is used exclusively to run your application's
@@ -9,4 +9,4 @@
9
9
 
10
10
  # Make sure your secret_key_base is kept private
11
11
  # if you're sharing your code publicly.
12
- Dummy::Application.config.secret_key_base = 'e5b3ea908abce0f8f00e313de72ff94345b074e30b4120a06bba04bcb0d48029db73ca838c7bddacb8c6a1f2fc2048f5fc50ab3d4c4c71c7cc50a5d369bf5d73'
12
+ TestApp::Application.config.secret_key_base = 'f06390ad51052262d28462663f5ee2bf3c8c0f0f14e390a4a26343591bf81d260786762233bfe7c849ecd74d4f46e4c6e91328837b3aa48098d2de4459f01484'
@@ -0,0 +1,3 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ TestApp::Application.config.session_store :cookie_store, key: '_test_app_session'