shareable_models 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (101) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +661 -0
  3. data/README.md +123 -0
  4. data/Rakefile +25 -0
  5. data/app/models/share_model.rb +18 -0
  6. data/lib/shareable_models/engine.rb +13 -0
  7. data/lib/shareable_models/models/shareable.rb +149 -0
  8. data/lib/shareable_models/models/sharer.rb +232 -0
  9. data/lib/shareable_models/share.rb +50 -0
  10. data/lib/shareable_models/version.rb +7 -0
  11. data/lib/shareable_models.rb +15 -0
  12. data/spec/dummy/Rakefile +3 -0
  13. data/spec/dummy/app/models/resource.rb +8 -0
  14. data/spec/dummy/app/models/user.rb +8 -0
  15. data/spec/dummy/config/application.rb +17 -0
  16. data/spec/dummy/config/boot.rb +5 -0
  17. data/spec/dummy/config/database.yml +25 -0
  18. data/spec/dummy/config/environment.rb +5 -0
  19. data/spec/dummy/config/environments/test.rb +42 -0
  20. data/spec/dummy/config/secrets.yml +3 -0
  21. data/spec/dummy/config.ru +4 -0
  22. data/spec/dummy/db/development.sqlite3 +0 -0
  23. data/spec/dummy/db/migrate/20150831110800_create_users.rb +8 -0
  24. data/spec/dummy/db/migrate/20150831110900_create_resources.rb +9 -0
  25. data/spec/dummy/db/schema.rb +41 -0
  26. data/spec/dummy/db/test.sqlite3 +0 -0
  27. data/spec/dummy/log/development.log +750 -0
  28. data/spec/dummy/log/test.log +3476 -0
  29. data/spec/dummy/tmp/cache/assets/CC1/7E0/sprockets%2F90700621d32c3e2ae2a4f912a72253ab +0 -0
  30. data/spec/dummy/tmp/cache/assets/CCF/6B0/sprockets%2Fa4652cd2ae14bbb5631a5a6480584905 +0 -0
  31. data/spec/dummy/tmp/cache/assets/D1C/290/sprockets%2Fe7f8e6b08f4ae6b9d49245564016ad27 +0 -0
  32. data/spec/dummy/tmp/cache/assets/D22/3A0/sprockets%2F3810c34c6ed797768acf9533ac9f086c +0 -0
  33. data/spec/dummy/tmp/cache/assets/D40/C10/sprockets%2F13484019fee8aed93d4d7f0342c0fa66 +0 -0
  34. data/spec/dummy/tmp/cache/assets/D6C/9B0/sprockets%2F49fc1144e2a91d5a71afc8da6d16387b +0 -0
  35. data/spec/dummy/tmp/cache/assets/DFD/6A0/sprockets%2Fa3e950d0cbe582637af2dd8caec45ed6 +0 -0
  36. data/spec/dummy/tmp/cache/assets/EEE/C40/sprockets%2Fb9ca5bee4dfcaa86005ef95ffcca5edb +0 -0
  37. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/-KhweS4Wy6LONwXNAAX21MuCb6S5pmcc2At-PRZTnVQ.cache +1 -0
  38. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/2E0BHjS9ga5CVF8p1i0BD342dTagEy6vpdptNnz4yi0.cache +1 -0
  39. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/2SiJB6jwY0ykyL_L-2XcQS_URsqxH2jewKoEcaXdRQI.cache +1 -0
  40. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/2b4LnUroZnwjtmAZ9wAlYXERumGQqZ06CtgLLqLlFZ4.cache +3 -0
  41. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/4yzlzceZQUxV0k8KLBaMF73Bn_2-WuesKO0HeG3c7TI.cache +1 -0
  42. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/57y6b0y31Rr9fh-AS-C-53-Pi2yM7ckkgwYIQeDIvu8.cache +3 -0
  43. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/5BpxDBRXPSEVa8E4oyZEZUcbmyodKDh45wQLjs9j7LA.cache +3 -0
  44. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/6ZWgaX4_0TmoMClNlDesNKcO2HO-goRDGx5iocHbsKo.cache +1 -0
  45. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/7F6McBtYiHW6rgiNy0YCvNTPhfMIOUrq7tsUI5xult8.cache +0 -0
  46. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/7w0mCgW__e7l2wA7VXo4H1RR91pDMz1nJLnqNtCqGvo.cache +1 -0
  47. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/8h7VuyG1HXfABXa1B4--Oi7NfJQvchxYp4XzbT-8aWA.cache +0 -0
  48. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/BRS6CEJIYcJNLwfTJZCdYoBa9bJKVzo4o2X9PlbCDyw.cache +1 -0
  49. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/CV97-tikdhGY51qhiE8LIBXJPysB-0urwrF9u7wOgQA.cache +3 -0
  50. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/E3jkQYtPcnSLkXBBARnRBrW1lTIIVrHyTHO2s689urA.cache +0 -0
  51. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/EKftD-LyK0JTxeLPzIiA90IkUlw-Rfu8hf1K2kIqJpE.cache +2 -0
  52. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/F4fl2U72q21ysGgeNZOyLkVCfw2dvQPjoEghki_D_8A.cache +1 -0
  53. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/F6RTFgWsLUC52NYLMkg2FeNKjgEZhSQS5NV1N3T0rGw.cache +1 -0
  54. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/IPsZefXeGnBC1-g2_BOJHuaCBLP6E60ISZQvjOn2QGc.cache +0 -0
  55. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/J0CARfIsAx4nD1Pk3q1NhG9xCHPOwGj9PaGu8z-ah1g.cache +3 -0
  56. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/Jaayipvdnp-lwqhyJiWdoGDwz5czFOMZLwducjDmfHc.cache +1 -0
  57. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/K5wHnruZLsDmlCHhkWMCagLWPKPM5bxwB2dv037yO5o.cache +1 -0
  58. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/KgWn-QmwEYBvpqByQM41ifUzsmOl40LnAJrCoq_oZcQ.cache +1 -0
  59. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/LAGHT0mMgGhdBGTKU8fpHrmHSQmt5fIoHTTi4kIOUJw.cache +2 -0
  60. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/T3dERBPkMEnJr8fvShtPBsFScRkir0lzJZQkpvrrct0.cache +0 -0
  61. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/UTAd4qlYa57uaORsIWcp6VqcAUkRzixYzIGoEFCvCrY.cache +3 -0
  62. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/UoWufV0QdgwAuVnwDXNWOQfgjGN6U7KnO2_2nXC5gHg.cache +0 -0
  63. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/WpToyjdG3xfOFtl4HJYTpy4_w0U40f7qQWUm7d2SDxg.cache +1 -0
  64. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/XwozjE91sFB4cQGoJUgr2jV1ZuRlvN_HTWgpclrD59A.cache +3 -0
  65. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/YAzUmPkKnALIIJE_0Meb0N5qTlBvVE1ront_B8yecfo.cache +1 -0
  66. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/Yuxa44Ctnn_uPp1nr47NdNwltrmTEp0PleFL3ylXbtM.cache +4 -0
  67. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/ZEUypIim5xuBK679jyb340c39nHQ3EvcgqbmeiHlT0c.cache +2 -0
  68. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/ZQf7Hy4n2V3c-98b9kqTrZAcw3B2TDRF3IKPm9I7VjY.cache +0 -0
  69. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/_SIN6dUlHiJyeUSpOPWAgfLfMrtjGlZgx8ZLEbkjLuQ.cache +1 -0
  70. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/_TUGtF7Vi9blFNr3awt9kgCoid35NdmY8hSHmxuaWbg.cache +2 -0
  71. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/_eb4NkdcbQR63aZySRq7Yv5_w_JReWqG2Q5mYA5u62s.cache +0 -0
  72. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/bPiSNDFYlW5YDua0D-fC4uPRV8hYABbCor092KHNzHM.cache +0 -0
  73. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/d3_09TJ2Uoh7sdjvHWw4jPVF0bObKu065NmgG-EIWcA.cache +0 -0
  74. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/dQTSoOSXec5z_sf_i4UrehHxFRAn4HbRvfh8mUEK2ME.cache +1 -0
  75. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/fVIC-zRTWj6S5SLH_vJQJY-ny5le0IaRQda1YLQQr68.cache +0 -0
  76. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/hpNHCD7sn3wufa6PLUdFP95AS8nwrAaL_b9K4X9_eCE.cache +1 -0
  77. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/huDMU1soBHMNsbUDXnTPbLtqvAEYPe6E-tLL9phYOBY.cache +2 -0
  78. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/i43TdJOVKXtyejasCbHJP4U34FcJ5siCLFWpnPWxxU4.cache +1 -0
  79. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/i4gUJwKC59hdrcb7ZaO09fNtKexVsb67-y3MZ7twsyI.cache +2 -0
  80. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/iynGcjYbH69ZuxdS02RrsK2y33uPjFHCrYHRxxNVn_k.cache +0 -0
  81. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/jR1PEBCdtdy135gPG-zLQDg25XQDP9eDBew7pmhz34k.cache +0 -0
  82. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/jvNKAnuW3TSUu3LxRcqdtmSHgoGiukm1onfXqD6glQA.cache +1 -0
  83. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/kOBlorvGjGDVFhapT1HrAw48XziyeSqexuiKpVhDMac.cache +1 -0
  84. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/mS-IpVGnBSf2F0bGZ7OPpXNCcNMtHmxm7TI1hHVlvps.cache +2 -0
  85. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/pKsozyUJjXN2tIwiCbkGt9AzwLwdpHCYC1Cib-9GBIo.cache +3 -0
  86. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/pP2ApxUxxz-JMscfDHnlZ4Hq4DybYrG_9B4npoDMGAE.cache +2 -0
  87. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/r9dDy892QJeXi_CLvyTWZvGA9idLCbq9X0lnwxr9RZQ.cache +1 -0
  88. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/rLeviNgrP2-MqSDlwBdtz3ciY9n32a5oY9NY3iQupsg.cache +1 -0
  89. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/rf04rP-66AEEH942fvU_IcXRtrpw1_xbvnaxHD2wZGA.cache +2 -0
  90. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/uSWRYxEuSTYl_g1MvbE90G-h747P1dyWDCSZY0z1yzA.cache +2 -0
  91. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/uifNaYvk6KYC76GaHQ9muL_ObOmw4C_CSl9lzOUfnDE.cache +3 -0
  92. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/yOVPU3Y8NJQjJYfkK-l7I_DPfd3T4mIccYc6gY6ODBQ.cache +1 -0
  93. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/yZA3xwYBnfhABCzMVYKNfJMWpJg4HEovQnr5t48Yrf0.cache +1 -0
  94. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/y_XqYDfeQ0fehcC3FNz-qYXXcwOxtSDfsJX1nStC1qU.cache +1 -0
  95. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/z_w2fR4GzVyUeMzrOEZKQSykA7SSjpdpLtlBgXEgcUA.cache +5 -0
  96. data/spec/fixtures/resources.yml +14 -0
  97. data/spec/fixtures/share_models.yml +8 -0
  98. data/spec/fixtures/users.yml +11 -0
  99. data/spec/models/share_model_spec.rb +148 -0
  100. data/spec/spec_helper.rb +20 -0
  101. metadata +303 -0
@@ -0,0 +1 @@
1
+ I"�file:///Users/angelmmiguel/Projects/material_icons/spec/dummy/app/assets/javascripts/application.js?type=application/javascript&id=66e9625310f838e4530f272b885bf8c9f69a510bb8ae0f46f004d9b7aeaa6967:ET
@@ -0,0 +1 @@
1
+ I"�file:///Users/angelmmiguel/Projects/material_icons/app/assets/fonts/MaterialIcons-Regular.woff2?id=33df0f0ad785d25a90fc9a059e16a97290aedf055e289782ccf3904f284f9ca7:ET
@@ -0,0 +1 @@
1
+ "%u��Yd'�ߛ8��l������XxO��L.��<�
@@ -0,0 +1,3 @@
1
+ {:uriI"�file:///Users/angelmmiguel/Projects/material_icons/app/assets/fonts/MaterialIcons-Regular.ttf?type=application/x-font-ttf&id=4ac9d92c374b3e4bf8925a7ac1ebd14bcdac8f440be8920b43ad22dd07acb222:ET:load_pathI"A/Users/angelmmiguel/Projects/material_icons/app/assets/fonts;T:
2
+ @hash{ I"environment-version;TTI"environment-paths;TTI"Lprocessors:type=application/x-font-ttf&file_type=application/x-font-ttf;TTI"ifile-digest:///Users/angelmmiguel/Projects/material_icons/app/assets/fonts/MaterialIcons-Regular.ttf;TT:dependencies_digest"%����p�*���2%S�^r5�A(8'����$�F:idI"E4ac9d92c374b3e4bf8925a7ac1ebd14bcdac8f440be8920b43ad22dd07acb222;F:
3
+ mtimel+y4jU
@@ -0,0 +1 @@
1
+ I"�/Users/angelmmiguel/Projects/material_icons/app/assets/fonts/MaterialIcons-Regular.eot?type=application/vnd.ms-fontobject&id=53dffa7f7ea57356296f6fb236e6649f280fd13512697328eab9268499da85fd:ET
@@ -0,0 +1,3 @@
1
+ {:uriI"�file:///Users/angelmmiguel/Projects/material_icons/app/assets/fonts/MaterialIcons-Regular.woff?type=application/font-woff&id=3dc4ebf604a468e4c637581a3c1f12082a273e37e8aeb779da90a6130bcc4daf:ET:load_pathI"A/Users/angelmmiguel/Projects/material_icons/app/assets/fonts;F:
2
+ @hash{ I"environment-version;TTI"environment-paths;TTI"Jprocessors:type=application/font-woff&file_type=application/font-woff;TTI"jfile-digest:///Users/angelmmiguel/Projects/material_icons/app/assets/fonts/MaterialIcons-Regular.woff;TT:dependencies_digest"%}����0�<�#q�n����;ų��\~�� �i�:idI"E3dc4ebf604a468e4c637581a3c1f12082a273e37e8aeb779da90a6130bcc4daf;F:
3
+ mtimel+z4jU
@@ -0,0 +1,3 @@
1
+ {:uriI"�file:///Users/angelmmiguel/Projects/material_icons/app/assets/fonts/MaterialIcons-Regular.woff?type=application/font-woff&id=910f78f7b697bdd510fd098186bb56a38c99d7702229e63833cd7a3e01c96461:ET:load_pathI"A/Users/angelmmiguel/Projects/material_icons/app/assets/fonts;T:
2
+ @hash{ I"environment-version;TTI"environment-paths;TTI"Jprocessors:type=application/font-woff&file_type=application/font-woff;TTI"jfile-digest:///Users/angelmmiguel/Projects/material_icons/app/assets/fonts/MaterialIcons-Regular.woff;TT:dependencies_digest"%�+�k�P�r�)�Ɯj�+^ ��n��F�&:idI"E910f78f7b697bdd510fd098186bb56a38c99d7702229e63833cd7a3e01c96461;F:
3
+ mtimel+z4jU
@@ -0,0 +1 @@
1
+ I"�file:///Users/angelmmiguel/Projects/material_icons/app/assets/stylesheets/material_icons.css.erb?type=text/css&pipeline=self&id=617f047fad69f94d18c73b39dde1c948b28bc44263a593bf5702a17840c6f7d5:ET
@@ -0,0 +1 @@
1
+ I"�/Users/angelmmiguel/Projects/material_icons/app/assets/fonts/MaterialIcons-Regular.ttf?type=application/x-font-ttf&id=560c53b1b65aa0592f6e5e736ef8f3cdea819e7fd0fe3d9ed9a9b16aef83f3f1:ET
@@ -0,0 +1 @@
1
+ I"�file:///Users/angelmmiguel/Projects/material_icons/app/assets/fonts/MaterialIcons-Regular.eot?type=application/vnd.ms-fontobject&id=1dbb729fd4c6e48e558d412ad39db7814711e076d7153202ca0374b8bd397a87:ET
@@ -0,0 +1,3 @@
1
+ [o:Set:
2
+ @hash{
3
+ I"environment-version:ETTI"environment-paths;TTI"Zprocessors:type=application/javascript&file_type=application/javascript&pipeline=self;TTI"ofile-digest:///Users/angelmmiguel/Projects/material_icons/spec/dummy/app/assets/javascripts/application.js;TTI"`file-digest:///Users/angelmmiguel/Projects/material_icons/spec/dummy/app/assets/javascripts;TT
@@ -0,0 +1,2 @@
1
+ [o:Set:
2
+ @hash{ I"environment-version:ETTI"environment-paths;TTI"Lprocessors:type=application/x-font-ttf&file_type=application/x-font-ttf;TTI"ifile-digest:///Users/angelmmiguel/Projects/material_icons/app/assets/fonts/MaterialIcons-Regular.ttf;TT
@@ -0,0 +1 @@
1
+ I"�file:///Users/angelmmiguel/Projects/material_icons/spec/dummy/app/assets/stylesheets/application.css?type=text/css&id=baaf439236445c560b3a5691d62705e37e06d871432d69bf0586b7cfdf80a52f:ET
@@ -0,0 +1 @@
1
+ I"�file:///Users/angelmmiguel/Projects/material_icons/app/assets/fonts/MaterialIcons-Regular.ttf?type=application/x-font-ttf&id=4489cc2d93d4e69898307c4fc3e62f6a412e330fe1b612aa5b5fbdd2f1035b65:ET
@@ -0,0 +1,3 @@
1
+ {:uriI"�file:///Users/angelmmiguel/Projects/material_icons/app/assets/fonts/MaterialIcons-Regular.ttf?type=application/x-font-ttf&id=4489cc2d93d4e69898307c4fc3e62f6a412e330fe1b612aa5b5fbdd2f1035b65:ET:load_pathI"A/Users/angelmmiguel/Projects/material_icons/app/assets/fonts;F:
2
+ @hash{ I"environment-version;TTI"environment-paths;TTI"Lprocessors:type=application/x-font-ttf&file_type=application/x-font-ttf;TTI"ifile-digest:///Users/angelmmiguel/Projects/material_icons/app/assets/fonts/MaterialIcons-Regular.ttf;TT:dependencies_digest"%� Ѽ�y��7+\�%�݇�Gw�W;u&���q�:idI"E4489cc2d93d4e69898307c4fc3e62f6a412e330fe1b612aa5b5fbdd2f1035b65;F:
3
+ mtimel+y4jU
@@ -0,0 +1 @@
1
+ I"�/Users/angelmmiguel/Projects/material_icons/app/assets/fonts/MaterialIcons-Regular.ttf?type=application/x-font-ttf&id=4ac9d92c374b3e4bf8925a7ac1ebd14bcdac8f440be8920b43ad22dd07acb222:ET
@@ -0,0 +1 @@
1
+ "%gjL] vC}���!<���R�5�+�/G��U�
@@ -0,0 +1 @@
1
+ "%��B�����șo�$'�A�d��L���xR�U
@@ -0,0 +1,2 @@
1
+ "%�ksy����׳`�3!"������
2
+ �V��y
@@ -0,0 +1,3 @@
1
+ {:uriI"�file:///Users/angelmmiguel/Projects/material_icons/app/assets/fonts/MaterialIcons-Regular.woff2?id=e56bfe542ef6c724a4c0bdbfc92fdc3f11efc2388ff6c21322a3ae753caee567:ET:load_pathI"A/Users/angelmmiguel/Projects/material_icons/app/assets/fonts;T:
2
+ @hash{ I"environment-version;TTI"environment-paths;TTI"processors:;TTI"kfile-digest:///Users/angelmmiguel/Projects/material_icons/app/assets/fonts/MaterialIcons-Regular.woff2;TT:dependencies_digest"%����rG#P�ү)Z+�����} �kl�!�:idI"Ee56bfe542ef6c724a4c0bdbfc92fdc3f11efc2388ff6c21322a3ae753caee567;F:
3
+ mtimel+{4jU
@@ -0,0 +1 @@
1
+ I"�file:///Users/angelmmiguel/Projects/material_icons/app/assets/fonts/MaterialIcons-Regular.woff?type=application/font-woff&id=3dc4ebf604a468e4c637581a3c1f12082a273e37e8aeb779da90a6130bcc4daf:ET
@@ -0,0 +1,3 @@
1
+ {:uriI"�file:///Users/angelmmiguel/Projects/material_icons/app/assets/fonts/MaterialIcons-Regular.eot?type=application/vnd.ms-fontobject&id=2a7a736db9aa4acde3f75feb4f25c3d8e0272d6185a1bd5b53dbadf81482c551:ET:load_pathI"A/Users/angelmmiguel/Projects/material_icons/app/assets/fonts;T:
2
+ @hash{ I"environment-version;TTI"environment-paths;TTI"Zprocessors:type=application/vnd.ms-fontobject&file_type=application/vnd.ms-fontobject;TTI"ifile-digest:///Users/angelmmiguel/Projects/material_icons/app/assets/fonts/MaterialIcons-Regular.eot;TT:dependencies_digest"%��y*y�2��=��؝i�Z�HԊ���:idI"E2a7a736db9aa4acde3f75feb4f25c3d8e0272d6185a1bd5b53dbadf81482c551;F:
3
+ mtimel+v4jU
@@ -0,0 +1 @@
1
+ I"�/Users/angelmmiguel/Projects/material_icons/app/assets/fonts/MaterialIcons-Regular.woff2?id=e56bfe542ef6c724a4c0bdbfc92fdc3f11efc2388ff6c21322a3ae753caee567:ET
@@ -0,0 +1,4 @@
1
+ {:uriI"�file:///Users/angelmmiguel/Projects/material_icons/app/assets/fonts/MaterialIcons-Regular.eot?type=application/vnd.ms-fontobject&id=1dbb729fd4c6e48e558d412ad39db7814711e076d7153202ca0374b8bd397a87:ET:load_pathI"A/Users/angelmmiguel/Projects/material_icons/app/assets/fonts;F:
2
+ @hash{ I"environment-version;TTI"environment-paths;TTI"Zprocessors:type=application/vnd.ms-fontobject&file_type=application/vnd.ms-fontobject;TTI"ifile-digest:///Users/angelmmiguel/Projects/material_icons/app/assets/fonts/MaterialIcons-Regular.eot;TT:dependencies_digest"%ǒ#ϓ"İ�d��
3
+ ܮYk��|���X��4:idI"E1dbb729fd4c6e48e558d412ad39db7814711e076d7153202ca0374b8bd397a87;F:
4
+ mtimel+v4jU
@@ -0,0 +1,2 @@
1
+ "%偺���m�~�t�P\h��)�s}i8
2
+ �.d5Y�
@@ -0,0 +1 @@
1
+ I"�/Users/angelmmiguel/Projects/material_icons/app/assets/fonts/MaterialIcons-Regular.eot?type=application/vnd.ms-fontobject&id=2a7a736db9aa4acde3f75feb4f25c3d8e0272d6185a1bd5b53dbadf81482c551:ET
@@ -0,0 +1,2 @@
1
+ [o:Set:
2
+ @hash{I"environment-version:ETTI"environment-paths;TTI">processors:type=text/css&file_type=text/css&pipeline=self;TTI"pfile-digest:///Users/angelmmiguel/Projects/material_icons/spec/dummy/app/assets/stylesheets/application.css;TTI"[file-digest:///Users/angelmmiguel/Projects/material_icons/spec/dummy/app/assets/images;TTI"jfile-digest:///Users/angelmmiguel/Projects/material_icons/spec/dummy/app/assets/images/material_icons;TTI"`file-digest:///Users/angelmmiguel/Projects/material_icons/spec/dummy/app/assets/javascripts;TTI"ofile-digest:///Users/angelmmiguel/Projects/material_icons/spec/dummy/app/assets/javascripts/material_icons;TTI"`file-digest:///Users/angelmmiguel/Projects/material_icons/spec/dummy/app/assets/stylesheets;TTI"ofile-digest:///Users/angelmmiguel/Projects/material_icons/spec/dummy/app/assets/stylesheets/material_icons;TTI"Ofile-digest:///Users/angelmmiguel/Projects/material_icons/app/assets/fonts;TTI"^file-digest:///Users/angelmmiguel/Projects/material_icons/app/assets/fonts/material_icons;TTI"Ufile-digest:///Users/angelmmiguel/Projects/material_icons/app/assets/stylesheets;TTI"dfile-digest:///Users/angelmmiguel/Projects/material_icons/app/assets/stylesheets/material_icons;TTI"lfile-digest:///Users/angelmmiguel/Projects/material_icons/app/assets/stylesheets/material_icons.css.erb;TT
@@ -0,0 +1 @@
1
+ "%�rژ�'�85�������9��;P��6x���J�
@@ -0,0 +1 @@
1
+ I"�/Users/angelmmiguel/Projects/material_icons/app/assets/fonts/MaterialIcons-Regular.woff?type=application/font-woff&id=f8d69ddb3a663132bd012e56208626a0fa4cf3bc191f6fda64e305a3a5e17198:ET
@@ -0,0 +1,2 @@
1
+ [o:Set:
2
+ @hash{%I"environment-version:ETTI"environment-paths;TTI"0processors:type=text/css&file_type=text/css;TTI"pfile-digest:///Users/angelmmiguel/Projects/material_icons/spec/dummy/app/assets/stylesheets/application.css;TTI"Kprocessors:type=text/css&file_type=text/css&engines=.erb&pipeline=self;TTI"lfile-digest:///Users/angelmmiguel/Projects/material_icons/app/assets/stylesheets/material_icons.css.erb;TTI"[file-digest:///Users/angelmmiguel/Projects/material_icons/spec/dummy/app/assets/images;TTI"qfile-digest:///Users/angelmmiguel/Projects/material_icons/spec/dummy/app/assets/images/MaterialIcons-Regular;TTI"`file-digest:///Users/angelmmiguel/Projects/material_icons/spec/dummy/app/assets/javascripts;TTI"vfile-digest:///Users/angelmmiguel/Projects/material_icons/spec/dummy/app/assets/javascripts/MaterialIcons-Regular;TTI"`file-digest:///Users/angelmmiguel/Projects/material_icons/spec/dummy/app/assets/stylesheets;TTI"vfile-digest:///Users/angelmmiguel/Projects/material_icons/spec/dummy/app/assets/stylesheets/MaterialIcons-Regular;TTI"Ofile-digest:///Users/angelmmiguel/Projects/material_icons/app/assets/fonts;TTI"efile-digest:///Users/angelmmiguel/Projects/material_icons/app/assets/fonts/MaterialIcons-Regular;TTI"ifile-digest:///Users/angelmmiguel/Projects/material_icons/app/assets/fonts/MaterialIcons-Regular.eot;TTI"Zprocessors:type=application/vnd.ms-fontobject&file_type=application/vnd.ms-fontobject;TTI"wfile-digest:///Users/angelmmiguel/Projects/material_icons/spec/dummy/app/assets/images/MaterialIcons-Regular.woff2;TTI"|file-digest:///Users/angelmmiguel/Projects/material_icons/spec/dummy/app/assets/javascripts/MaterialIcons-Regular.woff2;TTI"|file-digest:///Users/angelmmiguel/Projects/material_icons/spec/dummy/app/assets/stylesheets/MaterialIcons-Regular.woff2;TTI"kfile-digest:///Users/angelmmiguel/Projects/material_icons/app/assets/fonts/MaterialIcons-Regular.woff2;TTI"processors:;TTI"jfile-digest:///Users/angelmmiguel/Projects/material_icons/app/assets/fonts/MaterialIcons-Regular.woff;TTI"Jprocessors:type=application/font-woff&file_type=application/font-woff;TTI"ifile-digest:///Users/angelmmiguel/Projects/material_icons/app/assets/fonts/MaterialIcons-Regular.ttf;TTI"Lprocessors:type=application/x-font-ttf&file_type=application/x-font-ttf;TTI">processors:type=text/css&file_type=text/css&pipeline=self;TTI"jfile-digest:///Users/angelmmiguel/Projects/material_icons/spec/dummy/app/assets/images/material_icons;TTI"ofile-digest:///Users/angelmmiguel/Projects/material_icons/spec/dummy/app/assets/javascripts/material_icons;TTI"ofile-digest:///Users/angelmmiguel/Projects/material_icons/spec/dummy/app/assets/stylesheets/material_icons;TTI"^file-digest:///Users/angelmmiguel/Projects/material_icons/app/assets/fonts/material_icons;TTI"Ufile-digest:///Users/angelmmiguel/Projects/material_icons/app/assets/stylesheets;TTI"dfile-digest:///Users/angelmmiguel/Projects/material_icons/app/assets/stylesheets/material_icons;TT
@@ -0,0 +1 @@
1
+ "%-����k�ŏ�5g�A��A]������pMt^7/�
@@ -0,0 +1,2 @@
1
+ [o:Set:
2
+ @hash{ I"environment-version:ETTI"environment-paths;TTI"Jprocessors:type=application/font-woff&file_type=application/font-woff;TTI"jfile-digest:///Users/angelmmiguel/Projects/material_icons/app/assets/fonts/MaterialIcons-Regular.woff;TT
@@ -0,0 +1 @@
1
+ I"�file:///Users/angelmmiguel/Projects/material_icons/spec/dummy/app/assets/javascripts/application.js?type=application/javascript&pipeline=self&id=c95c8295d03d58c8d9705d763ea13f3612cebff590042ff1272b15ade0341516:ET
@@ -0,0 +1 @@
1
+ I"�/Users/angelmmiguel/Projects/material_icons/app/assets/fonts/MaterialIcons-Regular.woff2?id=0a2dc1aa8af9d7c71c3f204c247afcffede02aa62405e5a14eb6d14d7a4cbe86:ET
@@ -0,0 +1,2 @@
1
+ [o:Set:
2
+ @hash{ I"environment-version:ETTI"environment-paths;TTI"processors:;TTI"kfile-digest:///Users/angelmmiguel/Projects/material_icons/app/assets/fonts/MaterialIcons-Regular.woff2;TT
@@ -0,0 +1,3 @@
1
+ {:uriI"�file:///Users/angelmmiguel/Projects/material_icons/app/assets/fonts/MaterialIcons-Regular.woff2?id=0a2dc1aa8af9d7c71c3f204c247afcffede02aa62405e5a14eb6d14d7a4cbe86:ET:load_pathI"A/Users/angelmmiguel/Projects/material_icons/app/assets/fonts;T:
2
+ @hash{ I"environment-version;TTI"environment-paths;TTI"processors:;TTI"kfile-digest:///Users/angelmmiguel/Projects/material_icons/app/assets/fonts/MaterialIcons-Regular.woff2;TT:dependencies_digest"%��j����<#��m*�X�����1�{�/���:idI"E0a2dc1aa8af9d7c71c3f204c247afcffede02aa62405e5a14eb6d14d7a4cbe86;F:
3
+ mtimel+{4jU
@@ -0,0 +1,2 @@
1
+ [o:Set:
2
+ @hash{ I"environment-version:ETTI"environment-paths;TTI"Zprocessors:type=application/vnd.ms-fontobject&file_type=application/vnd.ms-fontobject;TTI"ifile-digest:///Users/angelmmiguel/Projects/material_icons/app/assets/fonts/MaterialIcons-Regular.eot;TT
@@ -0,0 +1 @@
1
+ I"�file:///Users/angelmmiguel/Projects/material_icons/spec/dummy/app/assets/stylesheets/application.css?type=text/css&pipeline=self&id=91aeb6292ae2d74581acbe5f9f1281b606e410afef74e2337d4f8f82f620ab7d:ET
@@ -0,0 +1 @@
1
+ "%��Rm�v�S3.��O�L���ڹc�ƕq�=_j�
@@ -0,0 +1,2 @@
1
+ [o:Set:
2
+ @hash{ I"environment-version:ETTI"environment-paths;TTI"Lprocessors:type=application/javascript&file_type=application/javascript;TTI"ofile-digest:///Users/angelmmiguel/Projects/material_icons/spec/dummy/app/assets/javascripts/application.js;TTI"Zprocessors:type=application/javascript&file_type=application/javascript&pipeline=self;TTI"`file-digest:///Users/angelmmiguel/Projects/material_icons/spec/dummy/app/assets/javascripts;TT
@@ -0,0 +1,2 @@
1
+ [o:Set:
2
+ @hash{I"environment-version:ETTI"environment-paths;TTI"Kprocessors:type=text/css&file_type=text/css&engines=.erb&pipeline=self;TTI"lfile-digest:///Users/angelmmiguel/Projects/material_icons/app/assets/stylesheets/material_icons.css.erb;TTI"[file-digest:///Users/angelmmiguel/Projects/material_icons/spec/dummy/app/assets/images;TTI"qfile-digest:///Users/angelmmiguel/Projects/material_icons/spec/dummy/app/assets/images/MaterialIcons-Regular;TTI"`file-digest:///Users/angelmmiguel/Projects/material_icons/spec/dummy/app/assets/javascripts;TTI"vfile-digest:///Users/angelmmiguel/Projects/material_icons/spec/dummy/app/assets/javascripts/MaterialIcons-Regular;TTI"`file-digest:///Users/angelmmiguel/Projects/material_icons/spec/dummy/app/assets/stylesheets;TTI"vfile-digest:///Users/angelmmiguel/Projects/material_icons/spec/dummy/app/assets/stylesheets/MaterialIcons-Regular;TTI"Ofile-digest:///Users/angelmmiguel/Projects/material_icons/app/assets/fonts;TTI"efile-digest:///Users/angelmmiguel/Projects/material_icons/app/assets/fonts/MaterialIcons-Regular;TTI"ifile-digest:///Users/angelmmiguel/Projects/material_icons/app/assets/fonts/MaterialIcons-Regular.eot;TTI"Zprocessors:type=application/vnd.ms-fontobject&file_type=application/vnd.ms-fontobject;TTI"wfile-digest:///Users/angelmmiguel/Projects/material_icons/spec/dummy/app/assets/images/MaterialIcons-Regular.woff2;TTI"|file-digest:///Users/angelmmiguel/Projects/material_icons/spec/dummy/app/assets/javascripts/MaterialIcons-Regular.woff2;TTI"|file-digest:///Users/angelmmiguel/Projects/material_icons/spec/dummy/app/assets/stylesheets/MaterialIcons-Regular.woff2;TTI"kfile-digest:///Users/angelmmiguel/Projects/material_icons/app/assets/fonts/MaterialIcons-Regular.woff2;TTI"processors:;TTI"jfile-digest:///Users/angelmmiguel/Projects/material_icons/app/assets/fonts/MaterialIcons-Regular.woff;TTI"Jprocessors:type=application/font-woff&file_type=application/font-woff;TTI"ifile-digest:///Users/angelmmiguel/Projects/material_icons/app/assets/fonts/MaterialIcons-Regular.ttf;TTI"Lprocessors:type=application/x-font-ttf&file_type=application/x-font-ttf;TT
@@ -0,0 +1,3 @@
1
+ {:uriI"�file:///Users/angelmmiguel/Projects/material_icons/app/assets/fonts/MaterialIcons-Regular.eot?type=application/vnd.ms-fontobject&id=53dffa7f7ea57356296f6fb236e6649f280fd13512697328eab9268499da85fd:ET:load_pathI"A/Users/angelmmiguel/Projects/material_icons/app/assets/fonts;T:
2
+ @hash{ I"environment-version;TTI"environment-paths;TTI"Zprocessors:type=application/vnd.ms-fontobject&file_type=application/vnd.ms-fontobject;TTI"ifile-digest:///Users/angelmmiguel/Projects/material_icons/app/assets/fonts/MaterialIcons-Regular.eot;TT:dependencies_digest"%P�ʁ->uP1 Wa�aYȳI��
3
+ mtimel+v4jU
@@ -0,0 +1 @@
1
+ "%s.ފ.#)*�=�)�Cp��ݦIvԟ����T��?L
@@ -0,0 +1 @@
1
+ "%��mґ'��כ�[y��ݫ�R�>�m��)�e
@@ -0,0 +1 @@
1
+ I"�/Users/angelmmiguel/Projects/material_icons/app/assets/fonts/MaterialIcons-Regular.woff?type=application/font-woff&id=910f78f7b697bdd510fd098186bb56a38c99d7702229e63833cd7a3e01c96461:ET
@@ -0,0 +1,5 @@
1
+ {:uriI"�file:///Users/angelmmiguel/Projects/material_icons/app/assets/fonts/MaterialIcons-Regular.woff?type=application/font-woff&id=f8d69ddb3a663132bd012e56208626a0fa4cf3bc191f6fda64e305a3a5e17198:ET:load_pathI"A/Users/angelmmiguel/Projects/material_icons/app/assets/fonts;T:
2
+ @hash{ I"environment-version;TTI"environment-paths;TTI"Jprocessors:type=application/font-woff&file_type=application/font-woff;TTI"jfile-digest:///Users/angelmmiguel/Projects/material_icons/app/assets/fonts/MaterialIcons-Regular.woff;TT:dependencies_digest"%��5��V��]Z��Þ
3
+ l
4
+ 7c�QRW"��:idI"Ef8d69ddb3a663132bd012e56208626a0fa4cf3bc191f6fda64e305a3a5e17198;F:
5
+ mtimel+z4jU
@@ -0,0 +1,14 @@
1
+ #
2
+ # Fixtures for resources
3
+ #
4
+ angel_resource:
5
+ name: Angel's resource
6
+ user: angel
7
+
8
+ jose_resource:
9
+ name: Jose's resource
10
+ user: jose
11
+
12
+ clara_resource:
13
+ name: Clara's resource
14
+ user: clara
@@ -0,0 +1,8 @@
1
+ #
2
+ # Fixtures for share models
3
+ #
4
+ angel_to_jose:
5
+ resource: angel_resource (Resource)
6
+ shared_to: jose (User)
7
+ shared_from: angel (User)
8
+ edit: false
@@ -0,0 +1,11 @@
1
+ #
2
+ # Fixture with users
3
+ #
4
+ angel:
5
+ name: Angel
6
+
7
+ jose:
8
+ name: Jose
9
+
10
+ clara:
11
+ name: Clara
@@ -0,0 +1,148 @@
1
+ require 'spec_helper'
2
+
3
+ describe ShareModel do
4
+
5
+ context 'Angel created a resource' do
6
+ before(:each) do
7
+ @resource = resources(:angel_resource)
8
+ @angel = users(:angel)
9
+ @clara = users(:clara)
10
+ @jose = users(:jose)
11
+ end
12
+
13
+ it 'has read and edit permissions' do
14
+ expect(@resource.editable_by?(@angel)).to be true
15
+ expect(@resource.readable_by?(@angel)).to be true
16
+ expect(@angel.can_edit?(@resource)).to be true
17
+ expect(@angel.can_read?(@resource)).to be true
18
+
19
+ # Check for Clara
20
+ expect(@resource.editable_by?(@clara)).to be false
21
+ expect(@resource.readable_by?(@clara)).to be false
22
+ expect(@clara.can_edit?(@resource)).to be false
23
+ expect(@clara.can_read?(@resource)).to be false
24
+ end
25
+
26
+ it 'can allow an user to read the report (Sharer model)' do
27
+ expect(@clara.can_read?(@resource)).to be false
28
+ expect(@clara.can_edit?(@resource)).to be false
29
+ # Invite the user from sharer model
30
+ expect(@angel.share(@resource, @clara)).to be true
31
+ expect(@clara.can_read?(@resource)).to be true
32
+ expect(@clara.can_edit?(@resource)).to be false
33
+ end
34
+
35
+ it 'can allow an user to read the report (Shareable model)' do
36
+ @resource.shared_with.destroy_all
37
+ # Invite the user from sharer model
38
+ expect(@resource.share_it(@angel, @clara)).to be true
39
+ expect(@resource.readable_by?(@clara)).to be true
40
+ expect(@resource.editable_by?(@clara)).to be false
41
+ end
42
+
43
+ it 'can allow an user to edit the report (Sharer model)' do
44
+ @resource.shared_with.destroy_all
45
+ # Invite the user from sharer model
46
+ expect(@angel.allow_edit(@resource, @clara)).to be true
47
+ expect(@clara.can_read?(@resource)).to be true
48
+ expect(@clara.can_edit?(@resource)).to be true
49
+ end
50
+
51
+ it 'can allow an user to edit the report (Shareable model)' do
52
+ @resource.shared_with.destroy_all
53
+ # Invite the user from sharer model
54
+ expect(@resource.allow_edit(@angel, @clara)).to be true
55
+ expect(@resource.readable_by?(@clara)).to be true
56
+ expect(@resource.editable_by?(@clara)).to be true
57
+ end
58
+
59
+ it 'can prevent edit the report (Sharer model)' do
60
+ @resource.shared_with.destroy_all
61
+ # Invite the user from sharer model
62
+ @resource.allow_edit(@angel, @clara)
63
+ expect(@resource.editable_by?(@clara)).to be true
64
+ @angel.prevent_edit(@resource, @clara)
65
+ expect(@clara.can_edit?(@resource)).to be false
66
+ end
67
+
68
+ it 'can prevent edit the report (Shareable model)' do
69
+ @resource.shared_with.destroy_all
70
+ # Invite the user from sharer model
71
+ @resource.allow_edit(@angel, @clara)
72
+ expect(@resource.editable_by?(@clara)).to be true
73
+ @resource.prevent_edit(@angel, @clara)
74
+ expect(@resource.editable_by?(@clara)).to be false
75
+ end
76
+
77
+ it 'can not leave the resource he was created' do
78
+ expect(@angel.leave(@resource)).to be false
79
+ expect(@resource.leave_by(@angel)).to be false
80
+ end
81
+
82
+ it 'can throw out Jose from resource' do
83
+ expect(@angel.throw_out(@resource, @jose)).to be true
84
+ expect(@resource.shared_with).not_to include(@jose)
85
+ end
86
+
87
+ it 'can throw out Jose from resource (from shareable)' do
88
+ expect(@resource.throw_out(@angel, @jose)).to be true
89
+ expect(@resource.shared_with).not_to include(@jose)
90
+ end
91
+ end
92
+
93
+ context "Jose hasn't got edit permissions on Angel's resource" do
94
+ before(:each) do
95
+ @resource = resources(:angel_resource)
96
+ @angel = users(:angel)
97
+ @jose = users(:jose)
98
+ @clara = users(:clara)
99
+ end
100
+
101
+ it 'has read but no edit permissions' do
102
+ expect(@resource.editable_by?(@jose)).to be false
103
+ expect(@resource.readable_by?(@jose)).to be true
104
+ expect(@jose.can_edit?(@resource)).to be false
105
+ expect(@jose.can_read?(@resource)).to be true
106
+ end
107
+
108
+ it 'fail when try to allow an user to read' do
109
+ expect(@resource.share_it(@jose, @clara)).to be false
110
+ expect(@jose.share(@resource, @clara)).to be false
111
+ end
112
+
113
+ it 'fail when try to allow an user to edit' do
114
+ expect(@resource.allow_edit(@jose, @clara)).to be false
115
+ expect(@jose.allow_edit(@resource, @clara)).to be false
116
+ end
117
+
118
+ it 'fail when try to allow himself to edit' do
119
+ expect(@resource.allow_edit(@jose, @jose)).to be false
120
+ expect(@jose.allow_edit(@resource, @jose)).to be false
121
+ end
122
+
123
+ it 'can leave the resource' do
124
+ expect(@jose.leave(@resource)).to be true
125
+ expect(@resource.shared_with).not_to include(@jose)
126
+ end
127
+
128
+ it 'can leave the resource (from shareable)' do
129
+ expect(@resource.leave_by(@jose)).to be true
130
+ expect(@resource.shared_with).not_to include(@jose)
131
+ end
132
+ end
133
+
134
+ context 'Anyone shared a resource with clara' do
135
+ before(:each) do
136
+ @resource = resources(:angel_resource)
137
+ @clara = users(:clara)
138
+ end
139
+
140
+ it 'try to leave the resource' do
141
+ expect(@clara.leave(@resource)).to be true
142
+ end
143
+
144
+ it 'try to leave the resource (from shareable)' do
145
+ expect(@resource.leave_by(@clara)).to be true
146
+ end
147
+ end
148
+ end
@@ -0,0 +1,20 @@
1
+ # Base configuration for RSPEC
2
+ ENV['RAILS_ENV'] ||= 'test'
3
+
4
+ require File.expand_path('../dummy/config/environment.rb', __FILE__)
5
+ require 'rspec/rails'
6
+
7
+ RSpec.configure do |config|
8
+ config.expect_with :rspec do |expectations|
9
+ expectations.include_chain_clauses_in_custom_matcher_descriptions = true
10
+ end
11
+ # For fixtures
12
+ config.use_transactional_fixtures = true
13
+ config.global_fixtures = :all
14
+ config.fixture_path = './spec/fixtures'
15
+
16
+ # rspec-mocks config goes here
17
+ config.mock_with :rspec do |mocks|
18
+ mocks.verify_partial_doubles = true
19
+ end
20
+ end