public
Created

Type error

  • Download Gist
controller.rb
Ruby
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
def update
@channel = current_user.channels.find(params[:id])
# make sure channel isn't social
#render :text => '' and return if @channel.social
if params["channel"]["video_type"].blank? && !params["channel"]["video_id"].blank?
@channel.errors.add(:base, t(:channel_video_type_blank))
end
if @channel.errors.count <= 0
puts "########## Params #{params.inspect}"
@channel.save_tags(params[:tags][:name])
@channel.update_attributes(params[:channel])
else
session[:errors] = @channel.errors
redirect_to channel_path(@channel.id, :anchor => "channelsettings") and return
end
 
flash[:notice] = t(:channel_update_success)
redirect_to channel_path(@channel.id)
 
end
spec.rb
Ruby
1 2 3 4 5 6 7
it "should allow a channel to be edited" do
@channel.public_flag = true
puts "###### tags = #{@tag} "
put :update, :id => @channel.id, :channel => @channel, :tags => @tag
response.should redirect_to channel_path(@channel.id)
 
end

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.