does not display spending proposals when filtering my activity
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user