class IdeasController < ApplicationController
  skip_before_filter :authenticate_user!, only: :index
  
  def index
    @ideas = Idea.all
  end

  def new
    @idea = Idea.new
  end

  def create
    @idea = Idea.new(params["idea"])
    if @idea.save
      redirect_to :root
    else
      render "new"
    end
    
  end

  def upvote
    @idea = Idea.find(params[:id])

    @idea.upvote!
    respond_to do |format|
      format.json { render json: { votes: @idea.votes } }
    end
  end
  
  def update
  	@idea = Idea.find(params[:id])
  	@idea.update_attributes(params[:idea])
  	redirect_to :root
  end
end

class IdeasController < ApplicationController
  skip_before_filter :authenticate_user!, only: :index
  
  def index
    @ideas = Idea.all
  end

  def new
    @idea = Idea.new
  end

  def create
    @idea = Idea.new(params["idea"])
    if @idea.save
      redirect_to :root
    else
      render "new"
    end
    
  end

  def upvote
    @idea = Idea.find(params[:id])

    @idea.upvote!
    respond_to do |format|
      format.json { render json: { votes: @idea.votes } }
    end
  end
  
  def update
  	@idea = Idea.find(params[:id])
  	#@idea.update_attributes(params[:idea])
  	redirect_to action: "index"
  end
end

Fix two examples, spec still does not test if update method is working, break update method to test spec.
Fix two examples, spec still does not test if update method is working, break update method to test spec.
