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:
Javi Martín
2019-09-19 23:35:14 +02:00
parent 5d6038f17f
commit 66334b5757
21 changed files with 45 additions and 9 deletions

View File

@@ -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