Add globalizable tests for all translatable models
So now we test in depth at the model level, and can be a bit more relaxed about integration tests for translations. Note we're defining some extra factories to make sure all translatable attributes with presence validation rules are mandatory. This way we can simplify the way we obtain required fields, using `required_attribute?`. Otherwise, fields having an `unless` condition in their presence validation rules would count as mandatory even when they're not.
This commit is contained in:
@@ -3,6 +3,8 @@ require "rails_helper"
|
||||
RSpec.describe SiteCustomization::Page, type: :model do
|
||||
let(:custom_page) { build(:site_customization_page) }
|
||||
|
||||
it_behaves_like "globalizable", :site_customization_page
|
||||
|
||||
it "is valid" do
|
||||
expect(custom_page).to be_valid
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user