feeder 0.3.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +119 -2
- data/app/controllers/feeder/application_controller.rb +1 -1
- data/app/controllers/feeder/items_controller.rb +7 -0
- data/app/models/feeder/feedable_observer.rb +43 -7
- data/app/models/feeder/item.rb +2 -6
- data/app/views/feeder/items/_item.html.erb +1 -1
- data/app/views/feeder/items/_item.json.jbuilder +1 -0
- data/app/views/feeder/{feeds → items}/index.html.erb +1 -1
- data/app/views/feeder/items/index.json.jbuilder +1 -0
- data/config/routes.rb +1 -1
- data/db/migrate/20140321085409_add_sticky_to_feeder_items.rb +5 -0
- data/db/migrate/20140401131911_prohibit_null_on_feeder_item_stickies.rb +13 -0
- data/db/migrate/20140526110451_add_blocked_to_feeder_items.rb +5 -0
- data/db/migrate/20140526110501_add_reported_to_feeder_items.rb +5 -0
- data/lib/feeder.rb +18 -2
- data/lib/feeder/active_record.rb +9 -0
- data/lib/feeder/concerns.rb +6 -0
- data/lib/feeder/concerns/controllers.rb +5 -0
- data/lib/feeder/concerns/controllers/items_controller.rb +22 -0
- data/lib/feeder/concerns/feedable.rb +27 -0
- data/lib/feeder/concerns/helpers.rb +5 -0
- data/lib/feeder/concerns/helpers/filter.rb +20 -0
- data/lib/feeder/concerns/models.rb +5 -0
- data/lib/feeder/concerns/models/item.rb +31 -0
- data/lib/feeder/configuration.rb +19 -5
- data/lib/feeder/engine.rb +3 -2
- data/lib/feeder/version.rb +1 -1
- data/spec/controllers/feeder/items_controller_spec.rb +36 -0
- data/spec/dummy/app/models/message.rb +2 -0
- data/spec/dummy/config/initializers/feeder.rb +1 -1
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/schema.rb +4 -1
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/development.log +359 -0
- data/spec/dummy/log/test.log +53050 -0
- data/spec/factories/feeder/items.rb +10 -0
- data/spec/lib/feeder/concerns/feedable_spec.rb +33 -0
- data/spec/lib/feeder/configuration_spec.rb +6 -6
- data/spec/lib/feeder_spec.rb +14 -2
- data/spec/models/feeder/feedable_observer_spec.rb +95 -0
- data/spec/models/feeder/item_spec.rb +38 -0
- data/spec/spec_helper.rb +4 -0
- data/spec/support/shared_examples/filterable.rb +48 -0
- metadata +97 -39
- data/app/controllers/feeder/feeds_controller.rb +0 -9
- data/app/views/layouts/feeder/application.html.erb +0 -14
- data/spec/controllers/feeder/feeds_controller_spec.rb +0 -27
@@ -1,14 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<title>Feeder</title>
|
5
|
-
<%= stylesheet_link_tag "feeder/application", media: "all" %>
|
6
|
-
<%= javascript_include_tag "feeder/application" %>
|
7
|
-
<%= csrf_meta_tags %>
|
8
|
-
</head>
|
9
|
-
<body>
|
10
|
-
|
11
|
-
<%= yield %>
|
12
|
-
|
13
|
-
</body>
|
14
|
-
</html>
|
@@ -1,27 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
module Feeder
|
4
|
-
describe FeedsController do
|
5
|
-
routes { Feeder::Engine.routes }
|
6
|
-
|
7
|
-
describe "GET 'index'" do
|
8
|
-
let!(:items) do
|
9
|
-
10.times.map do
|
10
|
-
m = Message.create header: 'Header', body: 'Body'
|
11
|
-
Item.create feedable: m, published_at: Time.zone.now
|
12
|
-
end.sort_by(&:published_at).reverse
|
13
|
-
end
|
14
|
-
|
15
|
-
it "returns http success" do
|
16
|
-
get :index
|
17
|
-
expect(response).to be_successful
|
18
|
-
end
|
19
|
-
|
20
|
-
it "fetches feed items ordered by publiction date, descending" do
|
21
|
-
get :index
|
22
|
-
expect(assigns(:items)).to eq items
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
end
|
27
|
-
end
|