Move exception tests to controller specs
System tests are used to test the application from the user's point of view. To test for specific exceptions, particularly regarding authorization permissions, controller tests fit better. Another option would be to test the page displayed shows a certain text, like "Internal server error". I'm choosing controller tests because they're faster and we're basically testing the same scenario many times and we've already got a test checking what happens when users access a page raising an exception.
This commit is contained in:
@@ -6,13 +6,6 @@ describe "Moderate budget investments" do
|
||||
let(:mod) { create(:moderator) }
|
||||
let!(:investment) { create(:budget_investment, heading: heading, author: create(:user)) }
|
||||
|
||||
scenario "Disabled with a feature flag" do
|
||||
Setting["process.budgets"] = nil
|
||||
login_as(mod.user)
|
||||
|
||||
expect { visit moderation_budget_investments_path }.to raise_exception(FeatureFlags::FeatureDisabled)
|
||||
end
|
||||
|
||||
scenario "Hiding an investment", :js do
|
||||
login_as(mod.user)
|
||||
visit budget_investment_path(budget, investment)
|
||||
|
||||
Reference in New Issue
Block a user