Files
nairobi/spec/features/tracking/budgets_spec.rb
Javi Martín 91c21b0982 Remove instance variables in RSpec
Instance variables might lead to hard-to-detect issues, since using a
nonexistent instance variable will return `nil` instead of raising an
error.
2019-09-30 16:43:10 +02:00

33 lines
759 B
Ruby

require "rails_helper"
describe "Tracking budgets" do
before do
tracker = create(:tracker, user: create(:user, username: "Rachel",
email: "rachel@trackers.org"))
login_as(tracker.user)
end
scenario "Disabled with a feature flag" do
Setting["process.budgets"] = nil
expect { visit tracking_budgets_path }.to raise_exception(FeatureFlags::FeatureDisabled)
end
context "Index" do
scenario "Displaying budgets" do
budget = create(:budget)
visit tracking_budgets_path
expect(page).to have_content(budget.name)
end
scenario "With no budgets" do
visit tracking_budgets_path
expect(page).to have_content "There are no budgets"
end
end
end