don't list public plugins
This commit is contained in:
		@@ -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>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -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
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -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
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user