Merge pull request #3427 from LextrendIT/feature/unify_valuator_and_admin_investment_pages

Display preview public page component on admin and valuators investment page
This commit is contained in:
Raimond Garcia
2019-06-11 14:44:45 +02:00
committed by GitHub
39 changed files with 294 additions and 452 deletions

View File

@@ -254,9 +254,9 @@ describe "Valuation budget investments" do
investment.update(visible_to_valuators: true)
visit valuation_budget_budget_investments_path(budget)
click_link investment.title
expect(page).to have_content("Investment preview")
expect(page).to have_content(investment.title)
expect(page).to have_content(investment.description)
expect(page).to have_content(investment.author.name)
@@ -278,6 +278,7 @@ describe "Valuation budget investments" do
visit valuation_budget_budget_investment_path(budget, investment)
expect(page).to have_content("Investment preview")
expect(page).to have_content(investment.title)
expect(page).to have_content(investment.description)
expect(page).to have_content(investment.author.name)
@@ -302,6 +303,22 @@ describe "Valuation budget investments" do
}.to raise_error "Not Found"
end
scenario "preview is visible" do
logout
login_as create(:administrator).user
visit valuation_budget_budget_investment_path(budget, investment)
expect(page).to have_content("Investment preview")
expect(page).to have_content(investment.title)
expect(page).to have_content(investment.description)
expect(page).to have_content(investment.author.name)
expect(page).to have_content(investment.heading.name)
expect(page).to have_content("1234")
expect(page).to have_content("Unfeasible")
expect(page).to have_content("It is impossible")
expect(page).to have_content("Ana (ana@admins.org)")
end
end
describe "Valuate" do