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).
23 lines
541 B
Ruby
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
|