Skip to content

Commit

Permalink
Moved notify action outside of secured area. BREAKS TESTS!
Browse files Browse the repository at this point in the history
  • Loading branch information
futurechimp committed Jun 11, 2011
1 parent fdd318e commit 9faf54b
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 8 deletions.
5 changes: 0 additions & 5 deletions admin/controllers/feeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 9 additions & 0 deletions app/controllers/updates.rb
Original file line number Diff line number Diff line change
@@ -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
7 changes: 7 additions & 0 deletions app/helpers/updates_helper.rb
Original file line number Diff line number Diff line change
@@ -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
5 changes: 2 additions & 3 deletions lib/octopus.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
13 changes: 13 additions & 0 deletions test/app/controllers/updates_controller_test.rb
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 9faf54b

Please sign in to comment.