don't list public plugins

This commit is contained in:
Lee Lawlor 2014-10-17 15:12:46 -04:00
parent 1b44dfbd4b
commit 06824f1957
3 changed files with 19 additions and 18 deletions

View File

@ -1,3 +1,4 @@
<!--
<div>
<%= render 'response' %>
<h2 id="index">List Public Plugins</h2>
@ -92,10 +93,10 @@ Example GET:
</pre>
</div>
-->
<div>
<%= render 'response' %>
<h2>List My Plugins</h2>
<h2 id="index">List My Plugins</h2>
</div>
<br>

View File

@ -127,7 +127,7 @@ Thingspeak::Application.routes.draw do
collection do
get 'private_plugins'
get 'public_plugins'
get 'public'
#get 'public'
end
end

View File

@ -20,23 +20,23 @@ describe PluginsController do
end
describe "Not Logged In" do
it "should display public plugins" do
get :public
response.should render_template('public')
end
#it "should display public plugins" do
# get :public
# response.should render_template('public')
#end
it "should show paginated list of public plugins as json" do
@plugin.update_column(:public_flag, true)
get :public, :format => :json
JSON.parse(response.body).keys.include?('pagination').should be_true
JSON.parse(response.body)['plugins'].length.should eq(1)
end
#it "should show paginated list of public plugins as json" do
# @plugin.update_column(:public_flag, true)
# get :public, :format => :json
# JSON.parse(response.body).keys.include?('pagination').should be_true
# JSON.parse(response.body)['plugins'].length.should eq(1)
#end
it "should not show private plugins" do
@plugin.update_column(:public_flag, false)
get :public, :format => :json
JSON.parse(response.body)['plugins'].length.should eq(0)
end
#it "should not show private plugins" do
# @plugin.update_column(:public_flag, false)
# get :public, :format => :json
# JSON.parse(response.body)['plugins'].length.should eq(0)
#end
end
describe "API" do