poptart 0.0.13 → 0.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/.ruby-version +1 -1
  3. data/lib/poptart.rb +1 -4
  4. data/lib/poptart/link.rb +9 -0
  5. data/lib/poptart/model.rb +13 -29
  6. data/lib/poptart/question.rb +21 -17
  7. data/lib/poptart/root.rb +10 -1
  8. data/lib/poptart/survey.rb +34 -7
  9. data/lib/poptart/survey_question.rb +32 -12
  10. data/lib/poptart/user.rb +4 -21
  11. data/lib/version.rb +1 -1
  12. data/poptart.gemspec +0 -4
  13. data/spec/lib/poptart/model_spec.rb +95 -0
  14. data/spec/lib/poptart/question_spec.rb +47 -0
  15. data/spec/lib/poptart/root_spec.rb +50 -0
  16. data/spec/lib/poptart/survey_question_spec.rb +166 -0
  17. data/spec/lib/poptart/survey_spec.rb +105 -0
  18. data/spec/lib/poptart/user_spec.rb +45 -0
  19. data/spec/requests/questions_spec.rb +31 -0
  20. data/spec/requests/survey_questions_spec.rb +150 -0
  21. data/spec/requests/surveys_spec.rb +34 -5
  22. data/spec/requests/{user_management_spec.rb → users_spec.rb} +5 -5
  23. data/spec/spec_helper.rb +1 -4
  24. data/spec/vcr/answering/survey_questions_answers_a_multiple_choice_question.yml +1527 -1596
  25. data/spec/vcr/answering/survey_questions_answers_a_survey_question.yml +2942 -2035
  26. data/spec/vcr/answering/survey_questions_creates_and_returns_a_random_question_survey.yml +254 -70
  27. data/spec/vcr/answering/survey_questions_creates_and_returns_an_empty_survey.yml +110 -48
  28. data/spec/vcr/answering/survey_questions_finds_survey_question_for_id.yml +1618 -286
  29. data/spec/vcr/poptart/survey/adds_a_question_to_a_survey.yml +1939 -0
  30. data/spec/vcr/poptart/survey/creates_a_random_survey.yml +318 -0
  31. data/spec/vcr/poptart/survey/creates_an_empty_survey.yml +702 -0
  32. data/spec/vcr/poptart/survey/returns_a_survey_by_id.yml +618 -0
  33. data/spec/vcr/poptart/user/creates_a_user.yml +179 -0
  34. data/spec/vcr/{user/management_creates_a_user.yml → poptart/user/returns_a_user.yml} +72 -69
  35. data/spec/vcr/questions/creates_a_question.yml +186 -0
  36. data/spec/vcr/questions/finds_a_question_by_id.yml +326 -0
  37. data/spec/vcr/questions/finds_a_question_by_key.yml +144 -0
  38. data/spec/vcr/questions/returns_all_answered_survey_questions_for_a_question.yml +1021 -0
  39. data/spec/vcr/retrieving/answers_returns_all_answered_survey_questions_for_a_question.yml +533 -479
  40. data/spec/vcr/survey/questions_answers_a_multiple_choice_question.yml +1454 -0
  41. data/spec/vcr/survey/questions_answers_a_survey_question.yml +1772 -0
  42. data/spec/vcr/survey/questions_creates_and_returns_an_empty_survey.yml +372 -0
  43. data/spec/vcr/survey/questions_finds_survey_question_for_id.yml +3083 -0
  44. data/spec/vcr/survey/questions_returns_all_answered_survey_questions_for_a_question.yml +5756 -0
  45. data/spec/vcr/survey/questions_returns_all_answered_survey_questions_for_a_question_by_key.yml +973 -0
  46. data/spec/vcr/survey/questions_returns_all_answered_survey_questions_for_a_survey.yml +620 -0
  47. metadata +55 -72
  48. data/lib/poptart/boolean_question.rb +0 -14
  49. data/lib/poptart/multiple_response_question.rb +0 -9
  50. data/lib/poptart/range_question.rb +0 -9
  51. data/lib/poptart/time_question.rb +0 -9
  52. data/spec/requests/answering_survey_questions_spec.rb +0 -79
  53. data/spec/requests/answers_spec.rb +0 -45
  54. data/spec/requests/creating_questions_spec.rb +0 -30
@@ -546,75 +546,6 @@ http_interactions:
546
546
  }
547
547
  http_version:
548
548
  recorded_at: Sat, 04 Oct 2014 15:30:08 GMT
549
- - request:
550
- method: get
551
- uri: http://localhost:3000/
552
- body:
553
- encoding: US-ASCII
554
- string: ''
555
- headers:
556
- User-Agent:
557
- - Faraday v0.9.0
558
- Content-Type:
559
- - application/json
560
- Api-Token:
561
- - testing
562
- Accept-Encoding:
563
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
564
- Accept:
565
- - "*/*"
566
- response:
567
- status:
568
- code: 200
569
- message: 'OK '
570
- headers:
571
- X-Frame-Options:
572
- - SAMEORIGIN
573
- X-Xss-Protection:
574
- - 1; mode=block
575
- X-Content-Type-Options:
576
- - nosniff
577
- X-Ua-Compatible:
578
- - chrome=1
579
- Content-Type:
580
- - application/json; charset=utf-8
581
- Etag:
582
- - '"224d26690c7c9c963202a6eb22d0a7d1"'
583
- Cache-Control:
584
- - max-age=0, private, must-revalidate
585
- X-Request-Id:
586
- - 18462046-fc0c-48c1-b90a-26372c917ad2
587
- X-Runtime:
588
- - '0.032400'
589
- Server:
590
- - WEBrick/1.3.1 (Ruby/2.1.2/2014-05-08)
591
- Date:
592
- - Sat, 04 Oct 2014 17:52:39 GMT
593
- Content-Length:
594
- - '347'
595
- Connection:
596
- - Keep-Alive
597
- body:
598
- encoding: UTF-8
599
- string: |-
600
- {
601
- "_links": {
602
- "self": {
603
- "href": "http://localhost:3000/"
604
- },
605
- "surveys": {
606
- "href": "http://localhost:3000/api/surveys{+id}/{?query*}"
607
- },
608
- "users": {
609
- "href": "http://localhost:3000/api/users{+id}/{?query*}"
610
- },
611
- "questions": {
612
- "href": "http://localhost:3000/api/questions{+id}/{?query*}"
613
- }
614
- }
615
- }
616
- http_version:
617
- recorded_at: Sat, 04 Oct 2014 17:52:39 GMT
618
549
  - request:
619
550
  method: get
620
551
  uri: http://localhost:3000/
@@ -1830,4 +1761,257 @@ http_interactions:
1830
1761
  }
1831
1762
  http_version:
1832
1763
  recorded_at: Sat, 18 Oct 2014 17:30:42 GMT
1833
- recorded_with: VCR 2.6.0
1764
+ - request:
1765
+ method: get
1766
+ uri: http://localhost:3000/
1767
+ body:
1768
+ encoding: US-ASCII
1769
+ string: ''
1770
+ headers:
1771
+ User-Agent:
1772
+ - Faraday v0.9.0
1773
+ Content-Type:
1774
+ - application/json
1775
+ Api-Token:
1776
+ - testing
1777
+ Accept-Encoding:
1778
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
1779
+ Accept:
1780
+ - "*/*"
1781
+ response:
1782
+ status:
1783
+ code: 500
1784
+ message: 'Internal Server Error '
1785
+ headers:
1786
+ Content-Type:
1787
+ - text/html; charset=utf-8
1788
+ Content-Length:
1789
+ - '13174'
1790
+ X-Request-Id:
1791
+ - 1eae61cc-50de-4a76-93eb-82d96df756b4
1792
+ X-Runtime:
1793
+ - '0.034419'
1794
+ Server:
1795
+ - WEBrick/1.3.1 (Ruby/2.1.3/2014-09-19)
1796
+ Date:
1797
+ - Sat, 17 Jan 2015 13:45:52 GMT
1798
+ Connection:
1799
+ - Keep-Alive
1800
+ body:
1801
+ encoding: UTF-8
1802
+ string: "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <meta charset=\"utf-8\"
1803
+ />\n <title>Action Controller: Exception caught</title>\n <style>\n body
1804
+ {\n background-color: #FAFAFA;\n color: #333;\n margin: 0px;\n
1805
+ \ }\n\n body, p, ol, ul, td {\n font-family: helvetica, verdana,
1806
+ arial, sans-serif;\n font-size: 13px;\n line-height: 18px;\n }\n\n
1807
+ \ pre {\n font-size: 11px;\n white-space: pre-wrap;\n }\n\n
1808
+ \ pre.box {\n border: 1px solid #EEE;\n padding: 10px;\n margin:
1809
+ 0px;\n width: 958px;\n }\n\n header {\n color: #F0F0F0;\n
1810
+ \ background: #C52F24;\n padding: 0.5em 1.5em;\n }\n\n h1 {\n
1811
+ \ margin: 0.2em 0;\n line-height: 1.1em;\n font-size: 2em;\n
1812
+ \ }\n\n h2 {\n color: #C52F24;\n line-height: 25px;\n }\n\n
1813
+ \ .details {\n border: 1px solid #D0D0D0;\n border-radius: 4px;\n
1814
+ \ margin: 1em 0px;\n display: block;\n width: 978px;\n }\n\n
1815
+ \ .summary {\n padding: 8px 15px;\n border-bottom: 1px solid #D0D0D0;\n
1816
+ \ display: block;\n }\n\n .details pre {\n margin: 5px;\n border:
1817
+ none;\n }\n\n #container {\n box-sizing: border-box;\n width:
1818
+ 100%;\n padding: 0 1.5em;\n }\n\n .source * {\n margin: 0px;\n
1819
+ \ padding: 0px;\n }\n\n .source {\n border: 1px solid #D9D9D9;\n
1820
+ \ background: #ECECEC;\n width: 978px;\n }\n\n .source pre
1821
+ {\n padding: 10px 0px;\n border: none;\n }\n\n .source .data
1822
+ {\n font-size: 80%;\n overflow: auto;\n background-color: #FFF;\n
1823
+ \ }\n\n .info {\n padding: 0.5em;\n }\n\n .source .data .line_numbers
1824
+ {\n background-color: #ECECEC;\n color: #AAA;\n padding: 1em
1825
+ .5em;\n border-right: 1px solid #DDD;\n text-align: right;\n }\n\n
1826
+ \ .line {\n padding-left: 10px;\n }\n\n .line:hover {\n background-color:
1827
+ #F6F6F6;\n }\n\n .line.active {\n background-color: #FFCCCC;\n
1828
+ \ }\n\n a { color: #980905; }\n a:visited { color: #666; }\n a:hover
1829
+ { color: #C52F24; }\n\n \n </style>\n\n <script>\n var toggle = function(id)
1830
+ {\n var s = document.getElementById(id).style;\n s.display = s.display
1831
+ == 'none' ? 'block' : 'none';\n return false;\n }\n var show =
1832
+ function(id) {\n document.getElementById(id).style.display = 'block';\n
1833
+ \ }\n var hide = function(id) {\n document.getElementById(id).style.display
1834
+ = 'none';\n }\n var toggleTrace = function() {\n return toggle('blame_trace');\n
1835
+ \ }\n var toggleSessionDump = function() {\n return toggle('session_dump');\n
1836
+ \ }\n var toggleEnvDump = function() {\n return toggle('env_dump');\n
1837
+ \ }\n </script>\n</head>\n<body>\n\n<header>\n <h1>\n PG::ConnectionBad\n
1838
+ \ </h1>\n</header>\n\n<div id=\"container\">\n <h2>could not connect to server:
1839
+ No such file or directory\n\tIs the server running locally and accepting\n\tconnections
1840
+ on Unix domain socket &quot;/tmp/.s.PGSQL.5432&quot;?\n</h2>\n\n \n \n<p><code>Rails.root:
1841
+ /Users/austenito/repos/happiness/happiness_service</code></p>\n\n<div id=\"traces\">\n
1842
+ \ <a href=\"#\" onclick=\"hide(&#39;Framework-Trace&#39;);hide(&#39;Full-Trace&#39;);show(&#39;Application-Trace&#39;);;
1843
+ return false;\">Application Trace</a> |\n <a href=\"#\" onclick=\"hide(&#39;Application-Trace&#39;);hide(&#39;Full-Trace&#39;);show(&#39;Framework-Trace&#39;);;
1844
+ return false;\">Framework Trace</a> |\n <a href=\"#\" onclick=\"hide(&#39;Application-Trace&#39;);hide(&#39;Framework-Trace&#39;);show(&#39;Full-Trace&#39;);;
1845
+ return false;\">Full Trace</a> \n\n <div id=\"Application-Trace\" style=\"display:
1846
+ block;\">\n <pre><code></code></pre>\n </div>\n <div id=\"Framework-Trace\"
1847
+ style=\"display: none;\">\n <pre><code>activerecord (4.0.4) lib/active_record/connection_adapters/postgresql_adapter.rb:848:in
1848
+ `initialize&#39;\nactiverecord (4.0.4) lib/active_record/connection_adapters/postgresql_adapter.rb:848:in
1849
+ `new&#39;\nactiverecord (4.0.4) lib/active_record/connection_adapters/postgresql_adapter.rb:848:in
1850
+ `connect&#39;\nactiverecord (4.0.4) lib/active_record/connection_adapters/postgresql_adapter.rb:556:in
1851
+ `initialize&#39;\nactiverecord (4.0.4) lib/active_record/connection_adapters/postgresql_adapter.rb:41:in
1852
+ `new&#39;\nactiverecord (4.0.4) lib/active_record/connection_adapters/postgresql_adapter.rb:41:in
1853
+ `postgresql_connection&#39;\nactiverecord (4.0.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:440:in
1854
+ `new_connection&#39;\nactiverecord (4.0.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:450:in
1855
+ `checkout_new_connection&#39;\nactiverecord (4.0.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:421:in
1856
+ `acquire_connection&#39;\nactiverecord (4.0.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:356:in
1857
+ `block in checkout&#39;\n/Users/austenito/.rubies/ruby-2.1.3/lib/ruby/2.1.0/monitor.rb:211:in
1858
+ `mon_synchronize&#39;\nactiverecord (4.0.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:355:in
1859
+ `checkout&#39;\nactiverecord (4.0.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:265:in
1860
+ `block in connection&#39;\n/Users/austenito/.rubies/ruby-2.1.3/lib/ruby/2.1.0/monitor.rb:211:in
1861
+ `mon_synchronize&#39;\nactiverecord (4.0.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:264:in
1862
+ `connection&#39;\nactiverecord (4.0.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:546:in
1863
+ `retrieve_connection&#39;\nactiverecord (4.0.4) lib/active_record/connection_handling.rb:79:in
1864
+ `retrieve_connection&#39;\nactiverecord (4.0.4) lib/active_record/connection_handling.rb:53:in
1865
+ `connection&#39;\nactiverecord (4.0.4) lib/active_record/migration.rb:796:in
1866
+ `current_version&#39;\nactiverecord (4.0.4) lib/active_record/migration.rb:804:in
1867
+ `needs_migration?&#39;\nactiverecord (4.0.4) lib/active_record/migration.rb:383:in
1868
+ `check_pending!&#39;\nactiverecord (4.0.4) lib/active_record/migration.rb:370:in
1869
+ `call&#39;\nactionpack (4.0.4) lib/action_dispatch/middleware/callbacks.rb:29:in
1870
+ `block in call&#39;\nactivesupport (4.0.4) lib/active_support/callbacks.rb:373:in
1871
+ `_run__4385228089887704791__call__callbacks&#39;\nactivesupport (4.0.4) lib/active_support/callbacks.rb:80:in
1872
+ `run_callbacks&#39;\nactionpack (4.0.4) lib/action_dispatch/middleware/callbacks.rb:27:in
1873
+ `call&#39;\nactionpack (4.0.4) lib/action_dispatch/middleware/reloader.rb:64:in
1874
+ `call&#39;\nactionpack (4.0.4) lib/action_dispatch/middleware/remote_ip.rb:76:in
1875
+ `call&#39;\nactionpack (4.0.4) lib/action_dispatch/middleware/debug_exceptions.rb:17:in
1876
+ `call&#39;\nactionpack (4.0.4) lib/action_dispatch/middleware/show_exceptions.rb:30:in
1877
+ `call&#39;\nrailties (4.0.4) lib/rails/rack/logger.rb:38:in `call_app&#39;\nrailties
1878
+ (4.0.4) lib/rails/rack/logger.rb:20:in `block in call&#39;\nactivesupport
1879
+ (4.0.4) lib/active_support/tagged_logging.rb:68:in `block in tagged&#39;\nactivesupport
1880
+ (4.0.4) lib/active_support/tagged_logging.rb:26:in `tagged&#39;\nactivesupport
1881
+ (4.0.4) lib/active_support/tagged_logging.rb:68:in `tagged&#39;\nrailties
1882
+ (4.0.4) lib/rails/rack/logger.rb:20:in `call&#39;\nactionpack (4.0.4) lib/action_dispatch/middleware/request_id.rb:21:in
1883
+ `call&#39;\nrack (1.5.2) lib/rack/runtime.rb:17:in `call&#39;\nactivesupport
1884
+ (4.0.4) lib/active_support/cache/strategy/local_cache.rb:83:in `call&#39;\nrack
1885
+ (1.5.2) lib/rack/lock.rb:17:in `call&#39;\nactionpack (4.0.4) lib/action_dispatch/middleware/static.rb:64:in
1886
+ `call&#39;\nrailties (4.0.4) lib/rails/engine.rb:511:in `call&#39;\nrailties
1887
+ (4.0.4) lib/rails/application.rb:97:in `call&#39;\nrack (1.5.2) lib/rack/lock.rb:17:in
1888
+ `call&#39;\nrack (1.5.2) lib/rack/content_length.rb:14:in `call&#39;\nrack
1889
+ (1.5.2) lib/rack/handler/webrick.rb:60:in `service&#39;\n/Users/austenito/.rubies/ruby-2.1.3/lib/ruby/2.1.0/webrick/httpserver.rb:138:in
1890
+ `service&#39;\n/Users/austenito/.rubies/ruby-2.1.3/lib/ruby/2.1.0/webrick/httpserver.rb:94:in
1891
+ `run&#39;\n/Users/austenito/.rubies/ruby-2.1.3/lib/ruby/2.1.0/webrick/server.rb:295:in
1892
+ `block in start_thread&#39;</code></pre>\n </div>\n <div id=\"Full-Trace\"
1893
+ style=\"display: none;\">\n <pre><code>activerecord (4.0.4) lib/active_record/connection_adapters/postgresql_adapter.rb:848:in
1894
+ `initialize&#39;\nactiverecord (4.0.4) lib/active_record/connection_adapters/postgresql_adapter.rb:848:in
1895
+ `new&#39;\nactiverecord (4.0.4) lib/active_record/connection_adapters/postgresql_adapter.rb:848:in
1896
+ `connect&#39;\nactiverecord (4.0.4) lib/active_record/connection_adapters/postgresql_adapter.rb:556:in
1897
+ `initialize&#39;\nactiverecord (4.0.4) lib/active_record/connection_adapters/postgresql_adapter.rb:41:in
1898
+ `new&#39;\nactiverecord (4.0.4) lib/active_record/connection_adapters/postgresql_adapter.rb:41:in
1899
+ `postgresql_connection&#39;\nactiverecord (4.0.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:440:in
1900
+ `new_connection&#39;\nactiverecord (4.0.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:450:in
1901
+ `checkout_new_connection&#39;\nactiverecord (4.0.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:421:in
1902
+ `acquire_connection&#39;\nactiverecord (4.0.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:356:in
1903
+ `block in checkout&#39;\n/Users/austenito/.rubies/ruby-2.1.3/lib/ruby/2.1.0/monitor.rb:211:in
1904
+ `mon_synchronize&#39;\nactiverecord (4.0.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:355:in
1905
+ `checkout&#39;\nactiverecord (4.0.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:265:in
1906
+ `block in connection&#39;\n/Users/austenito/.rubies/ruby-2.1.3/lib/ruby/2.1.0/monitor.rb:211:in
1907
+ `mon_synchronize&#39;\nactiverecord (4.0.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:264:in
1908
+ `connection&#39;\nactiverecord (4.0.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:546:in
1909
+ `retrieve_connection&#39;\nactiverecord (4.0.4) lib/active_record/connection_handling.rb:79:in
1910
+ `retrieve_connection&#39;\nactiverecord (4.0.4) lib/active_record/connection_handling.rb:53:in
1911
+ `connection&#39;\nactiverecord (4.0.4) lib/active_record/migration.rb:796:in
1912
+ `current_version&#39;\nactiverecord (4.0.4) lib/active_record/migration.rb:804:in
1913
+ `needs_migration?&#39;\nactiverecord (4.0.4) lib/active_record/migration.rb:383:in
1914
+ `check_pending!&#39;\nactiverecord (4.0.4) lib/active_record/migration.rb:370:in
1915
+ `call&#39;\nactionpack (4.0.4) lib/action_dispatch/middleware/callbacks.rb:29:in
1916
+ `block in call&#39;\nactivesupport (4.0.4) lib/active_support/callbacks.rb:373:in
1917
+ `_run__4385228089887704791__call__callbacks&#39;\nactivesupport (4.0.4) lib/active_support/callbacks.rb:80:in
1918
+ `run_callbacks&#39;\nactionpack (4.0.4) lib/action_dispatch/middleware/callbacks.rb:27:in
1919
+ `call&#39;\nactionpack (4.0.4) lib/action_dispatch/middleware/reloader.rb:64:in
1920
+ `call&#39;\nactionpack (4.0.4) lib/action_dispatch/middleware/remote_ip.rb:76:in
1921
+ `call&#39;\nactionpack (4.0.4) lib/action_dispatch/middleware/debug_exceptions.rb:17:in
1922
+ `call&#39;\nactionpack (4.0.4) lib/action_dispatch/middleware/show_exceptions.rb:30:in
1923
+ `call&#39;\nrailties (4.0.4) lib/rails/rack/logger.rb:38:in `call_app&#39;\nrailties
1924
+ (4.0.4) lib/rails/rack/logger.rb:20:in `block in call&#39;\nactivesupport
1925
+ (4.0.4) lib/active_support/tagged_logging.rb:68:in `block in tagged&#39;\nactivesupport
1926
+ (4.0.4) lib/active_support/tagged_logging.rb:26:in `tagged&#39;\nactivesupport
1927
+ (4.0.4) lib/active_support/tagged_logging.rb:68:in `tagged&#39;\nrailties
1928
+ (4.0.4) lib/rails/rack/logger.rb:20:in `call&#39;\nactionpack (4.0.4) lib/action_dispatch/middleware/request_id.rb:21:in
1929
+ `call&#39;\nrack (1.5.2) lib/rack/runtime.rb:17:in `call&#39;\nactivesupport
1930
+ (4.0.4) lib/active_support/cache/strategy/local_cache.rb:83:in `call&#39;\nrack
1931
+ (1.5.2) lib/rack/lock.rb:17:in `call&#39;\nactionpack (4.0.4) lib/action_dispatch/middleware/static.rb:64:in
1932
+ `call&#39;\nrailties (4.0.4) lib/rails/engine.rb:511:in `call&#39;\nrailties
1933
+ (4.0.4) lib/rails/application.rb:97:in `call&#39;\nrack (1.5.2) lib/rack/lock.rb:17:in
1934
+ `call&#39;\nrack (1.5.2) lib/rack/content_length.rb:14:in `call&#39;\nrack
1935
+ (1.5.2) lib/rack/handler/webrick.rb:60:in `service&#39;\n/Users/austenito/.rubies/ruby-2.1.3/lib/ruby/2.1.0/webrick/httpserver.rb:138:in
1936
+ `service&#39;\n/Users/austenito/.rubies/ruby-2.1.3/lib/ruby/2.1.0/webrick/httpserver.rb:94:in
1937
+ `run&#39;\n/Users/austenito/.rubies/ruby-2.1.3/lib/ruby/2.1.0/webrick/server.rb:295:in
1938
+ `block in start_thread&#39;</code></pre>\n </div>\n</div>\n\n \n\n<h2
1939
+ style=\"margin-top: 30px\">Request</h2>\n<p><b>Parameters</b>:</p> <pre>None</pre>\n\n<div
1940
+ class=\"details\">\n <div class=\"summary\"><a href=\"#\" onclick=\"return
1941
+ toggleSessionDump()\">Toggle session dump</a></div>\n <div id=\"session_dump\"
1942
+ style=\"display:none\"><pre></pre></div>\n</div>\n\n<div class=\"details\">\n
1943
+ \ <div class=\"summary\"><a href=\"#\" onclick=\"return toggleEnvDump()\">Toggle
1944
+ env dump</a></div>\n <div id=\"env_dump\" style=\"display:none\"><pre>GATEWAY_INTERFACE:
1945
+ &quot;CGI/1.1&quot;\nHTTP_ACCEPT: &quot;*/*&quot;\nHTTP_ACCEPT_ENCODING: &quot;gzip;q=1.0,deflate;q=0.6,identity;q=0.3&quot;\nREMOTE_ADDR:
1946
+ &quot;127.0.0.1&quot;\nREMOTE_HOST: &quot;127.0.0.1&quot;\nSERVER_NAME: &quot;localhost&quot;\nSERVER_PROTOCOL:
1947
+ &quot;HTTP/1.1&quot;</pre></div>\n</div>\n\n<h2 style=\"margin-top: 30px\">Response</h2>\n<p><b>Headers</b>:</p>
1948
+ <pre>None</pre>\n\n</div>\n\n\n</body>\n</html>\n"
1949
+ http_version:
1950
+ recorded_at: Sat, 17 Jan 2015 13:45:52 GMT
1951
+ - request:
1952
+ method: post
1953
+ uri: http://localhost:3000/api/user
1954
+ body:
1955
+ encoding: UTF-8
1956
+ string: "{}"
1957
+ headers:
1958
+ User-Agent:
1959
+ - Faraday v0.9.0
1960
+ Content-Type:
1961
+ - application/json
1962
+ Api-Token:
1963
+ - testing
1964
+ User-Token:
1965
+ - 0d729f94c6574de095bfe375a1f3ec46ebcf8ee99ff34c69cb401c92e0a15520
1966
+ Service-User-Id:
1967
+ - 5df349f6a5f7430b1cd971b24f9ba6b8513216303f5def500aa6617ff713b150
1968
+ Accept-Encoding:
1969
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
1970
+ Accept:
1971
+ - "*/*"
1972
+ response:
1973
+ status:
1974
+ code: 201
1975
+ message: 'Created '
1976
+ headers:
1977
+ X-Frame-Options:
1978
+ - SAMEORIGIN
1979
+ X-Xss-Protection:
1980
+ - 1; mode=block
1981
+ X-Content-Type-Options:
1982
+ - nosniff
1983
+ X-Ua-Compatible:
1984
+ - chrome=1
1985
+ Content-Type:
1986
+ - application/json; charset=utf-8
1987
+ Etag:
1988
+ - '"de3fa7aa07a0b82d966b780f9eeaa0e2"'
1989
+ Cache-Control:
1990
+ - max-age=0, private, must-revalidate
1991
+ X-Request-Id:
1992
+ - 3f91c8b2-8ddf-43d5-abf2-77d0e7296bbe
1993
+ X-Runtime:
1994
+ - '0.006287'
1995
+ Server:
1996
+ - WEBrick/1.3.1 (Ruby/2.1.3/2014-09-19)
1997
+ Date:
1998
+ - Sat, 17 Jan 2015 13:46:17 GMT
1999
+ Content-Length:
2000
+ - '256'
2001
+ Connection:
2002
+ - Keep-Alive
2003
+ body:
2004
+ encoding: UTF-8
2005
+ string: |-
2006
+ {
2007
+ "service_user_id": "5df349f6a5f7430b1cd971b24f9ba6b8513216303f5def500aa6617ff713b150",
2008
+ "_links": {
2009
+ "self": {
2010
+ "href": "http://localhost:3000/api/user"
2011
+ }
2012
+ },
2013
+ "token": "0d729f94c6574de095bfe375a1f3ec46ebcf8ee99ff34c69cb401c92e0a15520"
2014
+ }
2015
+ http_version:
2016
+ recorded_at: Sat, 17 Jan 2015 13:46:17 GMT
2017
+ recorded_with: VCR 2.9.3
@@ -744,6 +744,68 @@ http_interactions:
744
744
  }
745
745
  http_version:
746
746
  recorded_at: Sat, 04 Oct 2014 18:11:10 GMT
747
+ - request:
748
+ method: post
749
+ uri: http://localhost:3000/api/users
750
+ body:
751
+ encoding: UTF-8
752
+ string: "{}"
753
+ headers:
754
+ User-Agent:
755
+ - Faraday v0.9.0
756
+ Content-Type:
757
+ - application/json
758
+ Api-Token:
759
+ - testing
760
+ Accept-Encoding:
761
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
762
+ Accept:
763
+ - "*/*"
764
+ response:
765
+ status:
766
+ code: 201
767
+ message: 'Created '
768
+ headers:
769
+ X-Frame-Options:
770
+ - SAMEORIGIN
771
+ X-Xss-Protection:
772
+ - 1; mode=block
773
+ X-Content-Type-Options:
774
+ - nosniff
775
+ X-Ua-Compatible:
776
+ - chrome=1
777
+ Content-Type:
778
+ - application/json; charset=utf-8
779
+ Etag:
780
+ - '"0f52f77b40b6e63fcd539f7a32b5d7e8"'
781
+ Cache-Control:
782
+ - max-age=0, private, must-revalidate
783
+ X-Request-Id:
784
+ - a1bd105d-0c8a-4933-a6b0-883916cd2d99
785
+ X-Runtime:
786
+ - '0.013017'
787
+ Server:
788
+ - WEBrick/1.3.1 (Ruby/2.1.2/2014-05-08)
789
+ Date:
790
+ - Sat, 18 Oct 2014 17:30:41 GMT
791
+ Content-Length:
792
+ - '261'
793
+ Connection:
794
+ - Keep-Alive
795
+ body:
796
+ encoding: UTF-8
797
+ string: |-
798
+ {
799
+ "service_user_id": "d8cbe7ca7624cc03c9ed3bc9c959e92197da958e41dc91b1b5b6420bfcd30e31",
800
+ "_links": {
801
+ "self": {
802
+ "href": "http://localhost:3000/api/users/143"
803
+ }
804
+ },
805
+ "token": "8481296cc93de968c5c7171d87e232cb247e9879dc0f566101cd125bf7a7fee6"
806
+ }
807
+ http_version:
808
+ recorded_at: Sat, 18 Oct 2014 17:30:41 GMT
747
809
  - request:
748
810
  method: get
749
811
  uri: http://localhost:3000/
@@ -777,19 +839,19 @@ http_interactions:
777
839
  Content-Type:
778
840
  - application/json; charset=utf-8
779
841
  Etag:
780
- - '"2aa11a1ab77b139e58f765299f923a01"'
842
+ - '"cd727c0ba392005a102fbf8dc32be000"'
781
843
  Cache-Control:
782
844
  - max-age=0, private, must-revalidate
783
845
  X-Request-Id:
784
- - 41bf3126-6700-4929-a628-779e4da7b698
846
+ - f65d95af-a871-4f28-8b55-627df85349e6
785
847
  X-Runtime:
786
- - '0.006003'
848
+ - '0.007515'
787
849
  Server:
788
- - WEBrick/1.3.1 (Ruby/2.1.2/2014-05-08)
850
+ - WEBrick/1.3.1 (Ruby/2.1.3/2014-09-19)
789
851
  Date:
790
- - Sat, 18 Oct 2014 17:30:41 GMT
852
+ - Sat, 17 Jan 2015 14:05:19 GMT
791
853
  Content-Length:
792
- - '469'
854
+ - '479'
793
855
  Connection:
794
856
  - Keep-Alive
795
857
  body:
@@ -804,21 +866,21 @@ http_interactions:
804
866
  "href": "http://localhost:3000/api/surveys{/id}{?query*}"
805
867
  },
806
868
  "users": {
807
- "href": "http://localhost:3000/api/users{/id}{?query*}"
869
+ "href": "http://localhost:3000/api/user{/id}{?query*}"
808
870
  },
809
871
  "questions": {
810
872
  "href": "http://localhost:3000/api/questions{/id}{?query*}"
811
873
  },
812
874
  "survey_questions": {
813
- "href": "http://localhost:3000/api/questions{/question_id}/survey_questions{?query*}"
875
+ "href": "http://localhost:3000/api/questions/surveys/{survey_id}/survey_questions{/id}{?query*}"
814
876
  }
815
877
  }
816
878
  }
817
879
  http_version:
818
- recorded_at: Sat, 18 Oct 2014 17:30:41 GMT
880
+ recorded_at: Sat, 17 Jan 2015 14:05:19 GMT
819
881
  - request:
820
882
  method: post
821
- uri: http://localhost:3000/api/users
883
+ uri: http://localhost:3000/api/user
822
884
  body:
823
885
  encoding: UTF-8
824
886
  string: "{}"
@@ -849,35 +911,35 @@ http_interactions:
849
911
  Content-Type:
850
912
  - application/json; charset=utf-8
851
913
  Etag:
852
- - '"0f52f77b40b6e63fcd539f7a32b5d7e8"'
914
+ - '"d1543008c03a2390325182e6e3bd2464"'
853
915
  Cache-Control:
854
916
  - max-age=0, private, must-revalidate
855
917
  X-Request-Id:
856
- - a1bd105d-0c8a-4933-a6b0-883916cd2d99
918
+ - ec2e8185-787f-480b-ba78-490868a82dfc
857
919
  X-Runtime:
858
- - '0.013017'
920
+ - '0.009481'
859
921
  Server:
860
- - WEBrick/1.3.1 (Ruby/2.1.2/2014-05-08)
922
+ - WEBrick/1.3.1 (Ruby/2.1.3/2014-09-19)
861
923
  Date:
862
- - Sat, 18 Oct 2014 17:30:41 GMT
924
+ - Sat, 17 Jan 2015 14:05:19 GMT
863
925
  Content-Length:
864
- - '261'
926
+ - '256'
865
927
  Connection:
866
928
  - Keep-Alive
867
929
  body:
868
930
  encoding: UTF-8
869
931
  string: |-
870
932
  {
871
- "service_user_id": "d8cbe7ca7624cc03c9ed3bc9c959e92197da958e41dc91b1b5b6420bfcd30e31",
933
+ "service_user_id": "4c56b1623f7c0f2096d19c87b721d06b1d224e8474b97933fb40e553ecc842c4",
872
934
  "_links": {
873
935
  "self": {
874
- "href": "http://localhost:3000/api/users/143"
936
+ "href": "http://localhost:3000/api/user"
875
937
  }
876
938
  },
877
- "token": "8481296cc93de968c5c7171d87e232cb247e9879dc0f566101cd125bf7a7fee6"
939
+ "token": "23d9bc5844f6112732f52e44bf1961b5ae4fb3dd709e8d3640599c5bad088bdc"
878
940
  }
879
941
  http_version:
880
- recorded_at: Sat, 18 Oct 2014 17:30:41 GMT
942
+ recorded_at: Sat, 17 Jan 2015 14:05:19 GMT
881
943
  - request:
882
944
  method: get
883
945
  uri: http://localhost:3000/
@@ -892,9 +954,9 @@ http_interactions:
892
954
  Api-Token:
893
955
  - testing
894
956
  User-Token:
895
- - 8481296cc93de968c5c7171d87e232cb247e9879dc0f566101cd125bf7a7fee6
957
+ - 23d9bc5844f6112732f52e44bf1961b5ae4fb3dd709e8d3640599c5bad088bdc
896
958
  Service-User-Id:
897
- - d8cbe7ca7624cc03c9ed3bc9c959e92197da958e41dc91b1b5b6420bfcd30e31
959
+ - 4c56b1623f7c0f2096d19c87b721d06b1d224e8474b97933fb40e553ecc842c4
898
960
  Accept-Encoding:
899
961
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
900
962
  Accept:
@@ -915,19 +977,19 @@ http_interactions:
915
977
  Content-Type:
916
978
  - application/json; charset=utf-8
917
979
  Etag:
918
- - '"2aa11a1ab77b139e58f765299f923a01"'
980
+ - '"cd727c0ba392005a102fbf8dc32be000"'
919
981
  Cache-Control:
920
982
  - max-age=0, private, must-revalidate
921
983
  X-Request-Id:
922
- - 1f83e783-4b97-45ca-ad7a-c6396afc5e66
984
+ - f2a5fda1-0c79-49cd-9b10-c12edcc9676c
923
985
  X-Runtime:
924
- - '0.004936'
986
+ - '0.005093'
925
987
  Server:
926
- - WEBrick/1.3.1 (Ruby/2.1.2/2014-05-08)
988
+ - WEBrick/1.3.1 (Ruby/2.1.3/2014-09-19)
927
989
  Date:
928
- - Sat, 18 Oct 2014 17:30:41 GMT
990
+ - Sat, 17 Jan 2015 14:05:19 GMT
929
991
  Content-Length:
930
- - '469'
992
+ - '479'
931
993
  Connection:
932
994
  - Keep-Alive
933
995
  body:
@@ -942,24 +1004,24 @@ http_interactions:
942
1004
  "href": "http://localhost:3000/api/surveys{/id}{?query*}"
943
1005
  },
944
1006
  "users": {
945
- "href": "http://localhost:3000/api/users{/id}{?query*}"
1007
+ "href": "http://localhost:3000/api/user{/id}{?query*}"
946
1008
  },
947
1009
  "questions": {
948
1010
  "href": "http://localhost:3000/api/questions{/id}{?query*}"
949
1011
  },
950
1012
  "survey_questions": {
951
- "href": "http://localhost:3000/api/questions{/question_id}/survey_questions{?query*}"
1013
+ "href": "http://localhost:3000/api/questions/surveys/{survey_id}/survey_questions{/id}{?query*}"
952
1014
  }
953
1015
  }
954
1016
  }
955
1017
  http_version:
956
- recorded_at: Sat, 18 Oct 2014 17:30:41 GMT
1018
+ recorded_at: Sat, 17 Jan 2015 14:05:19 GMT
957
1019
  - request:
958
1020
  method: post
959
1021
  uri: http://localhost:3000/api/surveys
960
1022
  body:
961
1023
  encoding: UTF-8
962
- string: '{"survey":{"service_user_id":"d8cbe7ca7624cc03c9ed3bc9c959e92197da958e41dc91b1b5b6420bfcd30e31"}}'
1024
+ string: "{}"
963
1025
  headers:
964
1026
  User-Agent:
965
1027
  - Faraday v0.9.0
@@ -968,9 +1030,9 @@ http_interactions:
968
1030
  Api-Token:
969
1031
  - testing
970
1032
  User-Token:
971
- - 8481296cc93de968c5c7171d87e232cb247e9879dc0f566101cd125bf7a7fee6
1033
+ - 23d9bc5844f6112732f52e44bf1961b5ae4fb3dd709e8d3640599c5bad088bdc
972
1034
  Service-User-Id:
973
- - d8cbe7ca7624cc03c9ed3bc9c959e92197da958e41dc91b1b5b6420bfcd30e31
1035
+ - 4c56b1623f7c0f2096d19c87b721d06b1d224e8474b97933fb40e553ecc842c4
974
1036
  Accept-Encoding:
975
1037
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
976
1038
  Accept:
@@ -991,45 +1053,45 @@ http_interactions:
991
1053
  Content-Type:
992
1054
  - application/json; charset=utf-8
993
1055
  Etag:
994
- - '"ff0bef7cc50d44e314097f6d62aa6770"'
1056
+ - '"8a8a20e4a9be1ed8998385da04045f33"'
995
1057
  Cache-Control:
996
1058
  - max-age=0, private, must-revalidate
997
1059
  X-Request-Id:
998
- - e6251cca-bbe8-4558-9e99-f38ef1477a49
1060
+ - e1434f1d-d363-4a24-ae8b-fdd10093943e
999
1061
  X-Runtime:
1000
- - '0.018456'
1062
+ - '0.013080'
1001
1063
  Server:
1002
- - WEBrick/1.3.1 (Ruby/2.1.2/2014-05-08)
1064
+ - WEBrick/1.3.1 (Ruby/2.1.3/2014-09-19)
1003
1065
  Date:
1004
- - Sat, 18 Oct 2014 17:30:41 GMT
1066
+ - Sat, 17 Jan 2015 14:05:19 GMT
1005
1067
  Content-Length:
1006
- - '476'
1068
+ - '471'
1007
1069
  Connection:
1008
1070
  - Keep-Alive
1009
1071
  body:
1010
1072
  encoding: UTF-8
1011
1073
  string: |-
1012
1074
  {
1013
- "id": 178,
1014
- "service_user_id": "d8cbe7ca7624cc03c9ed3bc9c959e92197da958e41dc91b1b5b6420bfcd30e31",
1075
+ "id": 52,
1076
+ "service_user_id": "4c56b1623f7c0f2096d19c87b721d06b1d224e8474b97933fb40e553ecc842c4",
1015
1077
  "_links": {
1016
1078
  "self": {
1017
- "href": "http://localhost:3000/api/surveys/178"
1079
+ "href": "http://localhost:3000/api/surveys/52"
1018
1080
  },
1019
1081
  "survey_questions": {
1020
1082
  "post": {
1021
- "href": "http://localhost:3000/api/surveys/178/survey_questions"
1083
+ "href": "http://localhost:3000/api/surveys/52/survey_questions"
1022
1084
  },
1023
1085
  "put": {
1024
- "href": "http://localhost:3000/api/surveys/178/survey_questions"
1086
+ "href": "http://localhost:3000/api/surveys/52/survey_questions"
1025
1087
  }
1026
1088
  }
1027
1089
  },
1028
- "completed": false,
1090
+ "completed": true,
1029
1091
  "survey_questions": [
1030
1092
 
1031
1093
  ]
1032
1094
  }
1033
1095
  http_version:
1034
- recorded_at: Sat, 18 Oct 2014 17:30:41 GMT
1035
- recorded_with: VCR 2.6.0
1096
+ recorded_at: Sat, 17 Jan 2015 14:05:19 GMT
1097
+ recorded_with: VCR 2.9.3