Show results and stats settings only in budget edit view
This commit is contained in:
@@ -88,7 +88,9 @@
|
||||
<% end %>
|
||||
</fieldset>
|
||||
|
||||
<% if @budget.persisted? %>
|
||||
<%= render "admin/shared/show_results_fields", form: f %>
|
||||
<% end %>
|
||||
|
||||
<div class="small-12 column">
|
||||
<div class="clear small-12 medium-4 large-3 inline-block">
|
||||
|
||||
@@ -144,6 +144,15 @@ describe "Admin budgets", :admin do
|
||||
expect(page).to have_css(".is-invalid-label", text: "Name")
|
||||
expect(page).to have_css("small.form-error", text: "has already been taken")
|
||||
end
|
||||
|
||||
scenario "Do not show results and stats settings on new budget", :js do
|
||||
visit new_admin_budget_path
|
||||
|
||||
expect(page).not_to have_content "Show results and stats"
|
||||
expect(page).not_to have_field "Show results"
|
||||
expect(page).not_to have_field "Show stats"
|
||||
expect(page).not_to have_field "Show advanced stats"
|
||||
end
|
||||
end
|
||||
|
||||
context "Destroy" do
|
||||
@@ -216,6 +225,16 @@ describe "Admin budgets", :admin do
|
||||
end
|
||||
end
|
||||
|
||||
scenario "Show results and stats settings", :js do
|
||||
visit edit_admin_budget_path(budget)
|
||||
|
||||
within_fieldset "Show results and stats" do
|
||||
expect(page).to have_field "Show results"
|
||||
expect(page).to have_field "Show stats"
|
||||
expect(page).to have_field "Show advanced stats"
|
||||
end
|
||||
end
|
||||
|
||||
scenario "Changing name for current locale will update the slug if budget is in draft phase", :js do
|
||||
budget.update!(phase: "drafting")
|
||||
old_slug = budget.slug
|
||||
|
||||
Reference in New Issue
Block a user