Fix aspect edit

This commit is contained in:
Raphael 2011-01-17 17:36:36 -08:00
parent 3f21a05e3e
commit 8bd784e5ab
3 changed files with 15 additions and 1 deletions

View file

@ -77,7 +77,7 @@ class AspectsController < ApplicationController
end
def edit
@aspect = current_user.aspect_by_id params[:id]
@aspect = current_user.aspects.where(:id => params[:id]).first
@contacts = current_user.contacts.where(:pending => false)
unless @aspect
render :file => "#{Rails.root}/public/404.html", :layout => false, :status => 404

View file

@ -331,6 +331,13 @@ describe AspectsController do
end
end
describe '#edit' do
it 'renders' do
get :edit, :id => @aspect0.id
response.should be_success
end
end
describe "#remove_from_aspect" do
it 'removes contacts from an aspect' do
@user.add_contact_to_aspect(@contact, @aspect1)

View file

@ -74,6 +74,13 @@ describe PhotosController do
assigns[:ownership].should be_true
end
it "renders a show page for another user's photo" do
get :show, :id => photo2.id
response.status.should == 200
assigns[:photo].should == photo2
assigns[:ownership].should be_false
end
end
describe '#edit' do