diff --git a/admin/controllers/feeds.rb b/admin/controllers/feeds.rb index 6da4280..0dcef91 100644 --- a/admin/controllers/feeds.rb +++ b/admin/controllers/feeds.rb @@ -47,9 +47,4 @@ redirect url(:feeds, :index) end - post :notify, :with => :id do - @feed = Feed.find(params[:id]) - @feed.update_feed_items(params[:data]) - "success" - end end \ No newline at end of file diff --git a/app/controllers/updates.rb b/app/controllers/updates.rb new file mode 100644 index 0000000..760c72d --- /dev/null +++ b/app/controllers/updates.rb @@ -0,0 +1,9 @@ +Mongoaggro.controllers :updates do + + post :notify, :with => :id do + @feed = Feed.find(params[:id]) + @feed.update_feed_items(params[:data]) + "success" + end + +end \ No newline at end of file diff --git a/app/helpers/updates_helper.rb b/app/helpers/updates_helper.rb new file mode 100644 index 0000000..7549de4 --- /dev/null +++ b/app/helpers/updates_helper.rb @@ -0,0 +1,7 @@ +# Helper methods defined here can be accessed in any controller or view in the application + +Mongoaggro.helpers do + # def simple_helper_method + # ... + # end +end \ No newline at end of file diff --git a/lib/octopus.rb b/lib/octopus.rb index 6470ff4..a057b77 100644 --- a/lib/octopus.rb +++ b/lib/octopus.rb @@ -11,12 +11,11 @@ def self.create_resource(feed) :body => { :net_resource => { :url => feed.url }, :subscription => { - :url => "#{::SERVER_URL}/admin/feeds/notify/#{feed.id}" + :url => "#{::SERVER_URL}/updates/notify/#{feed.id}" } } } post( '/create', options) end -end - +end \ No newline at end of file diff --git a/test/app/controllers/updates_controller_test.rb b/test/app/controllers/updates_controller_test.rb new file mode 100644 index 0000000..70b1730 --- /dev/null +++ b/test/app/controllers/updates_controller_test.rb @@ -0,0 +1,13 @@ +require File.expand_path(File.dirname(__FILE__) + '/../../test_config.rb') + +class UpdatesControllerTest < Test::Unit::TestCase + context "UpdatesController" do + setup do + get '/' + end + + should "return hello world text" do + assert_equal "Hello World", last_response.body + end + end +end