diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 5c5e68741..1324fbdfa 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -23,7 +23,7 @@ class UsersController < ApplicationController when "proposals" then load_proposals when "debates" then load_debates when "comments" then load_comments - when "spending_proposals" then load_spending_proposals + when "spending_proposals" then load_spending_proposals if author_or_admin? else load_available_activity end end diff --git a/spec/features/users_spec.rb b/spec/features/users_spec.rb index 247a77293..4fbaf1937 100644 --- a/spec/features/users_spec.rb +++ b/spec/features/users_spec.rb @@ -207,7 +207,12 @@ feature 'Users' do end scenario 'is not shown if no user logged in' do - visit user_path(@user) + visit user_path(@author) + expect(page).to_not have_content('Build a school') + end + + scenario 'is not shown if no user logged in (filtered url)' do + visit user_path(@author, filter: 'spending_proposals') expect(page).to_not have_content('Build a school') end @@ -234,6 +239,7 @@ feature 'Users' do visit user_path(@author) expect(page).to have_content('Build a school') end + end end