Restaurant and Location models contains HABTM association. 
 how to write test cases for locations controller

```
def create
    @restaurant = Restaurant.find(params[:restaurant_id])
    @location =  @restaurant.locations.create(location_params)
    if @location.save   
        flash[:notice] = 'Location added!'   
        redirect_to admin_locations_path    
    else   
        flash[:error] = 'Failed to edit location!'   
        render :new   
    end   
end   

def update   
    @location = Location.find(params[:id])   
    if @location.update_attributes(location_params)   
        flash[:notice] = 'Location updated!'   
        redirect_to admin_locations_path   
    else   
        flash[:error] = 'Failed to edit Location!'   
        render :edit   
    end   
end    

```