fix channel JSON response
This commit is contained in:
		@@ -33,6 +33,7 @@ describe ChannelsController do
 | 
			
		||||
      @channel.name.should eq('new name')
 | 
			
		||||
      response.should redirect_to channel_path(@channel.id)
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    it "should allow a channel to be deleted " do
 | 
			
		||||
      delete :destroy, :id => @channel.id
 | 
			
		||||
      response.should redirect_to channels_path
 | 
			
		||||
@@ -134,6 +135,18 @@ describe ChannelsController do
 | 
			
		||||
      end
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    describe "show channel" do
 | 
			
		||||
      it 'shows a channel' do
 | 
			
		||||
        get :show, id: @channel.id
 | 
			
		||||
        response.should be_successful
 | 
			
		||||
      end
 | 
			
		||||
      it 'returns JSON' do
 | 
			
		||||
        get :show, id: @channel.id, format: 'json'
 | 
			
		||||
        JSON.parse(response.body)['name'].should eq(@channel.name)
 | 
			
		||||
        JSON.parse(response.body)['tags'].should eq([])
 | 
			
		||||
      end
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    describe "create channel" do
 | 
			
		||||
      it 'creates a channel' do
 | 
			
		||||
        post :create, {:key => @user.api_key, :name => 'mychannel'}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user