Fix valuators authorization spec

This spec used to pass, because even though there were no budgets, as
Budget.current returned an array, it gracefully handled situations
without budgets

Now we assume that there can only be a single current budget, and so
calling any method of budget will raise an exception unless there is a
current budget present

Valuators should not access this page when there is no budget present,
however it might be wise to create an issue to cover this case, just in
case
This commit is contained in:
rgarcia
2018-01-15 20:34:30 +01:00
parent 5086314bee
commit 34e0c23bb3

View File

@@ -66,6 +66,8 @@ feature 'Valuation' do
scenario 'Access as a valuator is authorized' do
create(:valuator, user: user)
create(:budget)
login_as(user)
visit root_path
@@ -78,6 +80,8 @@ feature 'Valuation' do
scenario 'Access as an administrator is authorized' do
create(:administrator, user: user)
create(:budget)
login_as(user)
visit root_path
@@ -90,6 +94,8 @@ feature 'Valuation' do
scenario "Valuation access links" do
create(:valuator, user: user)
create(:budget)
login_as(user)
visit root_path
@@ -100,6 +106,8 @@ feature 'Valuation' do
scenario 'Valuation dashboard' do
create(:valuator, user: user)
create(:budget)
login_as(user)
visit root_path