6330940a34
Test if the title and the description attributes of the Conference model are translatable. Also introduce a custom matcher for translatable attributes as there will be many. Fix a typo in the process.
15 lines
371 B
Ruby
15 lines
371 B
Ruby
RSpec::Matchers.define :have_translatable do |expected|
|
|
match do |actual|
|
|
I18n.locale = :bg
|
|
actual.send "#{expected.to_s}=", 'Test Bulgarian'
|
|
|
|
I18n.locale = :en
|
|
actual.send "#{expected.to_s}=", 'Test English'
|
|
|
|
expect(actual.send expected).to eq 'Test English'
|
|
|
|
I18n.locale = :bg
|
|
expect(actual.send expected).to eq 'Test Bulgarian'
|
|
end
|
|
end
|