Fix aspect edit
This commit is contained in:
parent
3f21a05e3e
commit
8bd784e5ab
3 changed files with 15 additions and 1 deletions
|
|
@ -77,7 +77,7 @@ class AspectsController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def edit
|
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)
|
@contacts = current_user.contacts.where(:pending => false)
|
||||||
unless @aspect
|
unless @aspect
|
||||||
render :file => "#{Rails.root}/public/404.html", :layout => false, :status => 404
|
render :file => "#{Rails.root}/public/404.html", :layout => false, :status => 404
|
||||||
|
|
|
||||||
|
|
@ -331,6 +331,13 @@ describe AspectsController do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe '#edit' do
|
||||||
|
it 'renders' do
|
||||||
|
get :edit, :id => @aspect0.id
|
||||||
|
response.should be_success
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
describe "#remove_from_aspect" do
|
describe "#remove_from_aspect" do
|
||||||
it 'removes contacts from an aspect' do
|
it 'removes contacts from an aspect' do
|
||||||
@user.add_contact_to_aspect(@contact, @aspect1)
|
@user.add_contact_to_aspect(@contact, @aspect1)
|
||||||
|
|
|
||||||
|
|
@ -74,6 +74,13 @@ describe PhotosController do
|
||||||
assigns[:ownership].should be_true
|
assigns[:ownership].should be_true
|
||||||
end
|
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
|
end
|
||||||
|
|
||||||
describe '#edit' do
|
describe '#edit' do
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue