The buttons to create polls associated with a budget were too prominent, appearing on the table as if they were as used as the link to manage investments. Most CONSUL installations don't use physical booths, and would probably wonder what that button is about. We're moving it to a more discrete place, at the bottom of the budget page. This way we can also split the action in two: on budgets not having a poll, we display the button in a not-so-accessible position (at the bottom of the page), since this button will only be used once per budget at most. Once the poll has been created, it means this feature is going to be used, so we display a link to manage ballots more prominently at the top of the page. If the budget has finished the final voting stage without creating a poll, we don't show either the link or the button because this feature can no longer be used. We're also adding some texts indicating what this feature is about, since it's probably one of the least understood features in CONSUL (probably because the interface is very confusing... but that's a different story). Since now from the budget page we can access every feature related to the budget, we can remove the "preview" action from the budgets index table, since this feature isn't that useful for budgets once they're published. Now the budgets table doesn't take as much space as it used to, although it's still too wide to be handled properly on devices with a small screen.
17 lines
530 B
Ruby
17 lines
530 B
Ruby
require "rails_helper"
|
|
|
|
describe Admin::Budgets::TableActionsComponent, controller: Admin::BaseController do
|
|
let(:budget) { create(:budget) }
|
|
let(:component) { Admin::Budgets::TableActionsComponent.new(budget) }
|
|
|
|
it "renders actions to edit budget and manage investments" do
|
|
render_inline component
|
|
|
|
expect(page).to have_link count: 2
|
|
expect(page).to have_link "Investment projects", href: /investments/
|
|
expect(page).to have_link "Edit", href: /#{budget.id}\Z/
|
|
|
|
expect(page).not_to have_button
|
|
end
|
|
end
|