Merge pull request #1015 from consul/investment-project-show
adds permissions for everyone to see investment projects
This commit is contained in:
@@ -113,42 +113,6 @@ feature 'Spending proposals' do
|
||||
expect(page).to have_content(spending_proposal.geozone.name)
|
||||
end
|
||||
|
||||
scenario "Show (as valuator)" do
|
||||
user = create(:user)
|
||||
admin = create(:valuator, user: user)
|
||||
login_as(admin.user)
|
||||
|
||||
spending_proposal = create(:spending_proposal,
|
||||
geozone: create(:geozone),
|
||||
association_name: 'People of the neighbourhood')
|
||||
|
||||
visit spending_proposal_path(spending_proposal)
|
||||
|
||||
expect(page).to have_content(spending_proposal.title)
|
||||
expect(page).to have_content(spending_proposal.description)
|
||||
expect(page).to have_content(spending_proposal.author.name)
|
||||
expect(page).to have_content(spending_proposal.association_name)
|
||||
expect(page).to have_content(spending_proposal.geozone.name)
|
||||
end
|
||||
|
||||
scenario "Show (as author)" do
|
||||
author = create(:user)
|
||||
login_as(author)
|
||||
|
||||
spending_proposal = create(:spending_proposal,
|
||||
geozone: create(:geozone),
|
||||
association_name: 'People of the neighbourhood',
|
||||
author: author)
|
||||
|
||||
visit spending_proposal_path(spending_proposal)
|
||||
|
||||
expect(page).to have_content(spending_proposal.title)
|
||||
expect(page).to have_content(spending_proposal.description)
|
||||
expect(page).to have_content(spending_proposal.author.name)
|
||||
expect(page).to have_content(spending_proposal.association_name)
|
||||
expect(page).to have_content(spending_proposal.geozone.name)
|
||||
end
|
||||
|
||||
scenario "Show (as user)" do
|
||||
user = create(:user)
|
||||
login_as(user)
|
||||
@@ -159,8 +123,11 @@ feature 'Spending proposals' do
|
||||
|
||||
visit spending_proposal_path(spending_proposal)
|
||||
|
||||
expect(page).to_not have_content(spending_proposal.title)
|
||||
expect(page).to have_content("You do not have permission to access this page")
|
||||
expect(page).to have_content(spending_proposal.title)
|
||||
expect(page).to have_content(spending_proposal.description)
|
||||
expect(page).to have_content(spending_proposal.author.name)
|
||||
expect(page).to have_content(spending_proposal.association_name)
|
||||
expect(page).to have_content(spending_proposal.geozone.name)
|
||||
end
|
||||
|
||||
context "Destroy" do
|
||||
|
||||
Reference in New Issue
Block a user