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.
17 lines
264 B
Ruby
17 lines
264 B
Ruby
require "rails_helper"
|
|
|
|
describe Banner do
|
|
|
|
let(:banner) { build(:banner) }
|
|
|
|
describe "Concerns" do
|
|
it_behaves_like "acts as paranoid", :banner
|
|
it_behaves_like "globalizable", :banner
|
|
end
|
|
|
|
it "is valid" do
|
|
expect(banner).to be_valid
|
|
end
|
|
|
|
end
|