does not display spending proposals when filtering my activity

This commit is contained in:
rgarcia
2016-02-21 21:35:10 +01:00
parent b6e519c6ab
commit 6221c70027
2 changed files with 8 additions and 2 deletions

View File

@@ -23,7 +23,7 @@ class UsersController < ApplicationController
when "proposals" then load_proposals when "proposals" then load_proposals
when "debates" then load_debates when "debates" then load_debates
when "comments" then load_comments 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 else load_available_activity
end end
end end

View File

@@ -207,7 +207,12 @@ feature 'Users' do
end end
scenario 'is not shown if no user logged in' do 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') expect(page).to_not have_content('Build a school')
end end
@@ -234,6 +239,7 @@ feature 'Users' do
visit user_path(@author) visit user_path(@author)
expect(page).to have_content('Build a school') expect(page).to have_content('Build a school')
end end
end end
end end