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> <div>
<%= render 'response' %> <%= render 'response' %>
<h2 id="index">List Public Plugins</h2> <h2 id="index">List Public Plugins</h2>
@ -92,10 +93,10 @@ Example GET:
</pre> </pre>
</div> </div>
-->
<div> <div>
<%= render 'response' %> <%= render 'response' %>
<h2>List My Plugins</h2> <h2 id="index">List My Plugins</h2>
</div> </div>
<br> <br>

View File

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

View File

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