enju_news 0.1.0.pre2 → 0.1.0.pre3
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.
- checksums.yaml +7 -0
 - data/app/controllers/news_posts_controller.rb +1 -0
 - data/app/models/enju_news/ability.rb +18 -0
 - data/app/models/news_feed.rb +15 -0
 - data/app/models/news_post.rb +20 -0
 - data/app/views/news_feeds/index.html.erb +2 -2
 - data/app/views/news_posts/_form.html.erb +1 -1
 - data/app/views/news_posts/index.html.erb +1 -1
 - data/lib/enju_news/version.rb +1 -1
 - data/spec/cassette_library/NewsFeed/should_fetch_feeds.yml +994 -0
 - data/spec/cassette_library/NewsFeed/should_get_content.yml +875 -0
 - data/spec/cassette_library/NewsFeed/should_not_get_content_if_the_feed_is_invalid.yml +122 -0
 - data/spec/cassette_library/NewsFeed/should_reload_content.yml +875 -0
 - data/spec/controllers/news_feeds_controller_spec.rb +1 -1
 - data/spec/dummy/app/models/ability.rb +15 -19
 - data/spec/dummy/db/test.sqlite3 +0 -0
 - data/spec/fixtures/news_feeds.yml +15 -0
 - data/spec/fixtures/news_posts.yml +20 -0
 - data/spec/models/news_feed_spec.rb +19 -5
 - data/spec/models/news_post_spec.rb +20 -0
 - data/spec/spec_helper.rb +7 -2
 - metadata +31 -42
 - data/spec/cassette_library/NewsFeed.yml +0 -1998
 - data/spec/support/vcr.rb +0 -9
 
| 
         @@ -0,0 +1,122 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            ---
         
     | 
| 
      
 2 
     | 
    
         
            +
            http_interactions:
         
     | 
| 
      
 3 
     | 
    
         
            +
            - request:
         
     | 
| 
      
 4 
     | 
    
         
            +
                method: get
         
     | 
| 
      
 5 
     | 
    
         
            +
                uri: http://example.com/invalid_feed
         
     | 
| 
      
 6 
     | 
    
         
            +
                body:
         
     | 
| 
      
 7 
     | 
    
         
            +
                  encoding: US-ASCII
         
     | 
| 
      
 8 
     | 
    
         
            +
                  string: ''
         
     | 
| 
      
 9 
     | 
    
         
            +
                headers:
         
     | 
| 
      
 10 
     | 
    
         
            +
                  accept-encoding:
         
     | 
| 
      
 11 
     | 
    
         
            +
                  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
         
     | 
| 
      
 12 
     | 
    
         
            +
                  accept:
         
     | 
| 
      
 13 
     | 
    
         
            +
                  - '*/*'
         
     | 
| 
      
 14 
     | 
    
         
            +
                  user-agent:
         
     | 
| 
      
 15 
     | 
    
         
            +
                  - Ruby
         
     | 
| 
      
 16 
     | 
    
         
            +
              response:
         
     | 
| 
      
 17 
     | 
    
         
            +
                status:
         
     | 
| 
      
 18 
     | 
    
         
            +
                  code: 302
         
     | 
| 
      
 19 
     | 
    
         
            +
                  message: Found
         
     | 
| 
      
 20 
     | 
    
         
            +
                headers:
         
     | 
| 
      
 21 
     | 
    
         
            +
                  location:
         
     | 
| 
      
 22 
     | 
    
         
            +
                  - http://www.iana.org/domains/example/
         
     | 
| 
      
 23 
     | 
    
         
            +
                  server:
         
     | 
| 
      
 24 
     | 
    
         
            +
                  - BigIP
         
     | 
| 
      
 25 
     | 
    
         
            +
                  connection:
         
     | 
| 
      
 26 
     | 
    
         
            +
                  - Keep-Alive
         
     | 
| 
      
 27 
     | 
    
         
            +
                  content-length:
         
     | 
| 
      
 28 
     | 
    
         
            +
                  - '0'
         
     | 
| 
      
 29 
     | 
    
         
            +
                body:
         
     | 
| 
      
 30 
     | 
    
         
            +
                  encoding: UTF-8
         
     | 
| 
      
 31 
     | 
    
         
            +
                  string: ''
         
     | 
| 
      
 32 
     | 
    
         
            +
                http_version: '1.0'
         
     | 
| 
      
 33 
     | 
    
         
            +
              recorded_at: Mon, 25 Feb 2013 06:51:52 GMT
         
     | 
| 
      
 34 
     | 
    
         
            +
            - request:
         
     | 
| 
      
 35 
     | 
    
         
            +
                method: get
         
     | 
| 
      
 36 
     | 
    
         
            +
                uri: http://www.iana.org/domains/example/
         
     | 
| 
      
 37 
     | 
    
         
            +
                body:
         
     | 
| 
      
 38 
     | 
    
         
            +
                  encoding: US-ASCII
         
     | 
| 
      
 39 
     | 
    
         
            +
                  string: ''
         
     | 
| 
      
 40 
     | 
    
         
            +
                headers:
         
     | 
| 
      
 41 
     | 
    
         
            +
                  accept-encoding:
         
     | 
| 
      
 42 
     | 
    
         
            +
                  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
         
     | 
| 
      
 43 
     | 
    
         
            +
                  accept:
         
     | 
| 
      
 44 
     | 
    
         
            +
                  - '*/*'
         
     | 
| 
      
 45 
     | 
    
         
            +
                  user-agent:
         
     | 
| 
      
 46 
     | 
    
         
            +
                  - Ruby
         
     | 
| 
      
 47 
     | 
    
         
            +
              response:
         
     | 
| 
      
 48 
     | 
    
         
            +
                status:
         
     | 
| 
      
 49 
     | 
    
         
            +
                  code: 302
         
     | 
| 
      
 50 
     | 
    
         
            +
                  message: FOUND
         
     | 
| 
      
 51 
     | 
    
         
            +
                headers:
         
     | 
| 
      
 52 
     | 
    
         
            +
                  date:
         
     | 
| 
      
 53 
     | 
    
         
            +
                  - Mon, 25 Feb 2013 06:51:55 GMT
         
     | 
| 
      
 54 
     | 
    
         
            +
                  server:
         
     | 
| 
      
 55 
     | 
    
         
            +
                  - Apache/2.2.3 (CentOS)
         
     | 
| 
      
 56 
     | 
    
         
            +
                  location:
         
     | 
| 
      
 57 
     | 
    
         
            +
                  - http://www.iana.org/domains/example
         
     | 
| 
      
 58 
     | 
    
         
            +
                  content-length:
         
     | 
| 
      
 59 
     | 
    
         
            +
                  - '0'
         
     | 
| 
      
 60 
     | 
    
         
            +
                  connection:
         
     | 
| 
      
 61 
     | 
    
         
            +
                  - close
         
     | 
| 
      
 62 
     | 
    
         
            +
                  content-type:
         
     | 
| 
      
 63 
     | 
    
         
            +
                  - text/html; charset=utf-8
         
     | 
| 
      
 64 
     | 
    
         
            +
                body:
         
     | 
| 
      
 65 
     | 
    
         
            +
                  encoding: UTF-8
         
     | 
| 
      
 66 
     | 
    
         
            +
                  string: ''
         
     | 
| 
      
 67 
     | 
    
         
            +
                http_version: '1.1'
         
     | 
| 
      
 68 
     | 
    
         
            +
              recorded_at: Mon, 25 Feb 2013 06:51:53 GMT
         
     | 
| 
      
 69 
     | 
    
         
            +
            - request:
         
     | 
| 
      
 70 
     | 
    
         
            +
                method: get
         
     | 
| 
      
 71 
     | 
    
         
            +
                uri: http://www.iana.org/domains/example
         
     | 
| 
      
 72 
     | 
    
         
            +
                body:
         
     | 
| 
      
 73 
     | 
    
         
            +
                  encoding: US-ASCII
         
     | 
| 
      
 74 
     | 
    
         
            +
                  string: ''
         
     | 
| 
      
 75 
     | 
    
         
            +
                headers:
         
     | 
| 
      
 76 
     | 
    
         
            +
                  accept-encoding:
         
     | 
| 
      
 77 
     | 
    
         
            +
                  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
         
     | 
| 
      
 78 
     | 
    
         
            +
                  accept:
         
     | 
| 
      
 79 
     | 
    
         
            +
                  - '*/*'
         
     | 
| 
      
 80 
     | 
    
         
            +
                  user-agent:
         
     | 
| 
      
 81 
     | 
    
         
            +
                  - Ruby
         
     | 
| 
      
 82 
     | 
    
         
            +
              response:
         
     | 
| 
      
 83 
     | 
    
         
            +
                status:
         
     | 
| 
      
 84 
     | 
    
         
            +
                  code: 200
         
     | 
| 
      
 85 
     | 
    
         
            +
                  message: OK
         
     | 
| 
      
 86 
     | 
    
         
            +
                headers:
         
     | 
| 
      
 87 
     | 
    
         
            +
                  date:
         
     | 
| 
      
 88 
     | 
    
         
            +
                  - Mon, 25 Feb 2013 06:51:55 GMT
         
     | 
| 
      
 89 
     | 
    
         
            +
                  server:
         
     | 
| 
      
 90 
     | 
    
         
            +
                  - Apache/2.2.3 (CentOS)
         
     | 
| 
      
 91 
     | 
    
         
            +
                  last-modified:
         
     | 
| 
      
 92 
     | 
    
         
            +
                  - Fri, 04 Jan 2013 01:17:22 GMT
         
     | 
| 
      
 93 
     | 
    
         
            +
                  content-length:
         
     | 
| 
      
 94 
     | 
    
         
            +
                  - '606'
         
     | 
| 
      
 95 
     | 
    
         
            +
                  vary:
         
     | 
| 
      
 96 
     | 
    
         
            +
                  - Accept-Encoding
         
     | 
| 
      
 97 
     | 
    
         
            +
                  content-encoding:
         
     | 
| 
      
 98 
     | 
    
         
            +
                  - gzip
         
     | 
| 
      
 99 
     | 
    
         
            +
                  connection:
         
     | 
| 
      
 100 
     | 
    
         
            +
                  - close
         
     | 
| 
      
 101 
     | 
    
         
            +
                  content-type:
         
     | 
| 
      
 102 
     | 
    
         
            +
                  - text/html; charset=UTF-8
         
     | 
| 
      
 103 
     | 
    
         
            +
                body:
         
     | 
| 
      
 104 
     | 
    
         
            +
                  encoding: UTF-8
         
     | 
| 
      
 105 
     | 
    
         
            +
                  string: "<!doctype html>\n<html>\n<head>\n\t<title>Example Domain</title>\n\n\t<meta
         
     | 
| 
      
 106 
     | 
    
         
            +
                    charset=\"utf-8\" />\n\t<meta http-equiv=\"Content-type\" content=\"text/html;
         
     | 
| 
      
 107 
     | 
    
         
            +
                    charset=utf-8\" />\n\t<meta name=\"viewport\" content=\"width=device-width,
         
     | 
| 
      
 108 
     | 
    
         
            +
                    initial-scale=1\" />\n\t<style type=\"text/css\">\n\tbody {\n\t\tbackground-color:
         
     | 
| 
      
 109 
     | 
    
         
            +
                    #f0f0f2;\n\t\tmargin: 0;\n\t\tpadding: 0;\n\t\tfont-family: \"Open Sans\",
         
     | 
| 
      
 110 
     | 
    
         
            +
                    \"Helvetica Neue\", Helvetica, Arial, sans-serif;\n\t\t\n\t}\n\tdiv {\n\t\twidth:
         
     | 
| 
      
 111 
     | 
    
         
            +
                    600px;\n\t\tmargin: 5em auto;\n\t\tpadding: 3em;\n\t\tbackground-color: #fff;\n\t\tborder-radius:
         
     | 
| 
      
 112 
     | 
    
         
            +
                    1em;\n\t}\n\ta:link, a:visited {\n\t\tcolor: #38488f;\n\t\ttext-decoration:
         
     | 
| 
      
 113 
     | 
    
         
            +
                    none;\n\t}\n\t@media (max-width: 600px) {\n\t\tbody {\n\t\t\tbackground-color:
         
     | 
| 
      
 114 
     | 
    
         
            +
                    #fff;\n\t\t}\n\t\tdiv {\n\t\t\twidth: auto;\n\t\t\tmargin: 0 auto;\n\t\t\tborder-radius:
         
     | 
| 
      
 115 
     | 
    
         
            +
                    0;\n\t\t\tpadding: 1em;\n\t\t}\n\t}\n\t</style>\t\n</head>\n\n<body>\n<div>\n\t<h1>Example
         
     | 
| 
      
 116 
     | 
    
         
            +
                    Domain</h1>\n\t<p>This domain is established to be used for illustrative examples
         
     | 
| 
      
 117 
     | 
    
         
            +
                    in documents. You do not need to\n\t\tcoordinate or ask for permission to
         
     | 
| 
      
 118 
     | 
    
         
            +
                    use this domain in examples, and it is not available for\n\t\tregistration.</p>\n\t<p><a
         
     | 
| 
      
 119 
     | 
    
         
            +
                    href=\"http://www.iana.org/domains/special\">More information...</a></p>\n</div>\n</body>\n</html>\n"
         
     | 
| 
      
 120 
     | 
    
         
            +
                http_version: '1.1'
         
     | 
| 
      
 121 
     | 
    
         
            +
              recorded_at: Mon, 25 Feb 2013 06:51:53 GMT
         
     | 
| 
      
 122 
     | 
    
         
            +
            recorded_with: VCR 2.4.0
         
     |