don't redirect to AspectsController#new from AspectsController#index if no aspect is present
This commit is contained in:
parent
36a9e1643e
commit
fe915ecb09
3 changed files with 2 additions and 19 deletions
|
|
@ -18,12 +18,6 @@ class AspectsController < ApplicationController
|
|||
@aspects = current_user.aspects
|
||||
@aspects = @aspects.where(:id => params[:a_ids]) if params[:a_ids]
|
||||
|
||||
# redirect to aspects creation
|
||||
if @aspects.blank?
|
||||
redirect_to new_aspect_path
|
||||
return
|
||||
end
|
||||
|
||||
@aspect_ids = @aspects.map { |a| a.id }
|
||||
@posts = current_user.visible_posts(:by_members_of => @aspect_ids,
|
||||
:type => ['StatusMessage','Reshare', 'ActivityStreams::Photo'],
|
||||
|
|
|
|||
|
|
@ -1,12 +1,13 @@
|
|||
#selected_aspect_contacts.section
|
||||
.title.no_icon
|
||||
%h5
|
||||
- if all_aspects_selected? || @aspect_ids.size > 1
|
||||
- if all_aspects_selected? || !@aspect || @aspect_ids.size > 1
|
||||
= "#{t('_contacts')}"
|
||||
- else
|
||||
= @aspect.name
|
||||
= "(#{count})"
|
||||
|
||||
|
||||
.content
|
||||
- if people.size > 0
|
||||
- for person in people
|
||||
|
|
|
|||
|
|
@ -152,18 +152,6 @@ describe AspectsController do
|
|||
end
|
||||
end
|
||||
|
||||
context 'with no aspects' do
|
||||
before do
|
||||
alice.aspects.each { |aspect| aspect.destroy }
|
||||
alice.reload
|
||||
end
|
||||
|
||||
it 'redirects to the new aspect page' do
|
||||
get :index
|
||||
response.should redirect_to new_aspect_path
|
||||
end
|
||||
end
|
||||
|
||||
context 'with posts in multiple aspects' do
|
||||
before do
|
||||
@posts = []
|
||||
|
|
|
|||
Loading…
Reference in a new issue