Add related content section on proposal dashboard

This commit is contained in:
decabeza
2019-06-06 16:37:24 +02:00
committed by Javi Martín
parent cb6539d170
commit abf04bea4c
9 changed files with 58 additions and 1 deletions

View File

@@ -389,6 +389,31 @@ describe "Proposal's dashboard" do
anchor: "tab-notifications"))
end
scenario "Dashboard has a related content section" do
related_debate = create(:debate)
related_proposal = create(:proposal)
create(:related_content, parent_relationable: proposal,
child_relationable: related_debate, author: build(:user))
create(:related_content, parent_relationable: proposal,
child_relationable: related_proposal, author: build(:user))
within("#side_menu") do
click_link "Related content"
end
expect(page).to have_button("Add related content")
within(".dashboard-related-content") do
expect(page).to have_content("Related content (2)")
expect(page).to have_selector(".related-content-title", text: "Proposal")
expect(page).to have_link related_proposal.title
expect(page).to have_selector(".related-content-title", text: "Debate")
expect(page).to have_link related_debate.title
end
end
scenario "On recommended actions section display from the fourth proposed actions
when click see_proposed_actions_link", js: true do
create_list(:dashboard_action, 4, :proposed_action, :active)