add ability to get my channels via API

This commit is contained in:
Lee Lawlor
2014-05-19 12:31:31 -04:00
parent 5402830ec3
commit c28007ff2d
6 changed files with 156 additions and 4 deletions

View File

@ -114,6 +114,18 @@ describe ChannelsController do
@feed = FactoryGirl.create(:feed, :field1 => 10, :channel => @channel)
end
describe "list channels" do
it "should not list my channels" do
get :index, {:api_key => 'INVALID', :format => 'json'}
response.status.should eq(401)
end
it "lists my channels" do
get :index, {:api_key => @user.api_key, :format => 'json'}
response.should be_successful
end
end
describe "create channel" do
it 'creates a channel' do
post :create, {:key => @user.api_key, :name => 'mychannel'}