Files
ubicloud/spec/routes/api/show_errors_spec.rb
Jeremy Evans feb1c97ff5 Mark project_id columns newly added to tables as NOT NULL
These columns are now populated and required during insert.
This causes a large amount of fallout in the specs, as there
were many places that inserted rows without having a related
project.

No changes outside the specs except for
ApiKey#create_personal_access_token, which now requires a
project keyword argument, since the method would fail without
it now (the was previously optional).
2025-01-17 12:47:51 -08:00

23 lines
541 B
Ruby

# frozen_string_literal: true
require_relative "spec_helper"
RSpec.describe Clover do
before do
unless (@show_errors = ENV["SHOW_ERRORS"])
ENV["SHOW_ERRORS"] = "1"
end
@account = create_account
login_api(@account.email)
end
after do
ENV.delete("SHOW_ERRORS") unless @show_errors
end
it "supports SHOW_ERRORS environment variable when testing" do
project_with_default_policy(@account, name: "project-1")
expect { post "/project", {}.to_json }.to raise_error Committee::InvalidRequest
end
end