Remove warning in aspectscontroller
This commit is contained in:
parent
3c6dd3d721
commit
ad48f4796c
2 changed files with 9 additions and 1 deletions
|
|
@ -70,7 +70,11 @@ class AspectsController < ApplicationController
|
|||
|
||||
def show
|
||||
@aspect = current_user.aspects.where(:id => params[:id]).first
|
||||
redirect_to aspects_path('a_ids[]' => @aspect.id)
|
||||
if @aspect
|
||||
redirect_to aspects_path('a_ids[]' => @aspect.id)
|
||||
else
|
||||
redirect_to aspects_path
|
||||
end
|
||||
end
|
||||
|
||||
def edit
|
||||
|
|
|
|||
|
|
@ -105,6 +105,10 @@ describe AspectsController do
|
|||
get :show, 'id' => @aspect0.id.to_s
|
||||
response.should be_redirect
|
||||
end
|
||||
it 'redirects on an invalid id' do
|
||||
get :show, 'id' => 4341029835
|
||||
response.should be_redirect
|
||||
end
|
||||
end
|
||||
|
||||
describe "#create" do
|
||||
|
|
|
|||
Loading…
Reference in a new issue