Add draft info on unpublished budgets

Before commit 28caabecd, it was clear which budgets were in draft mode
because their phase was "drafting".

Now the phase isn't "drafting" anymore, so we have to make it clear
somehow that the budget is a draft.

I'm using styles similar to the ones we added in commit 2f636eaf7 for
completed budgets but at the same time making them slightly different so
it's easy to differenciate completed and drafting budgets.
This commit is contained in:
Javi Martín
2021-04-21 14:15:02 +02:00
parent 0eedc7b6ab
commit fc1a0f33e7
5 changed files with 34 additions and 8 deletions

View File

@@ -27,7 +27,7 @@ describe "Admin budgets", :admin do
end
scenario "Filters by phase" do
create(:budget, :drafting, name: "Drafting budget")
create(:budget, :drafting, name: "Unpublished budget")
create(:budget, :accepting, name: "Accepting budget")
create(:budget, :selecting, name: "Selecting budget")
create(:budget, :balloting, name: "Balloting budget")
@@ -35,18 +35,21 @@ describe "Admin budgets", :admin do
visit admin_budgets_path
expect(page).to have_content "Drafting budget"
expect(page).to have_content "Accepting budget"
expect(page).to have_content "Selecting budget"
expect(page).to have_content "Balloting budget"
within "tr", text: "Unpublished budget" do
expect(page).to have_content "Draft"
end
within "tr", text: "Finished budget" do
expect(page).to have_content "COMPLETED"
end
click_link "Finished"
expect(page).not_to have_content "Drafting budget"
expect(page).not_to have_content "Unpublished budget"
expect(page).not_to have_content "Accepting budget"
expect(page).not_to have_content "Selecting budget"
expect(page).not_to have_content "Balloting budget"
@@ -54,7 +57,7 @@ describe "Admin budgets", :admin do
click_link "Open"
expect(page).to have_content "Drafting budget"
expect(page).to have_content "Unpublished budget"
expect(page).to have_content "Accepting budget"
expect(page).to have_content "Selecting budget"
expect(page).to have_content "Balloting budget"