Create RemoteTranslation model
- Each RemoteTranslation is associated with a resource (through polymorphic) and has the locale to we want translate. - After create a RemoteTranslation we create a enqueue_remote_translation method that will be send remote translation instance to remote translation client
This commit is contained in:
32
spec/models/remote_translation_spec.rb
Normal file
32
spec/models/remote_translation_spec.rb
Normal file
@@ -0,0 +1,32 @@
|
||||
require "rails_helper"
|
||||
|
||||
describe RemoteTranslation do
|
||||
|
||||
let(:remote_translation) { build(:remote_translation, locale: :es) }
|
||||
|
||||
it "is valid" do
|
||||
expect(remote_translation).to be_valid
|
||||
end
|
||||
|
||||
it "is valid without error_message" do
|
||||
remote_translation.error_message = nil
|
||||
expect(remote_translation).to be_valid
|
||||
end
|
||||
|
||||
it "is not valid without to" do
|
||||
remote_translation.locale = nil
|
||||
expect(remote_translation).not_to be_valid
|
||||
end
|
||||
|
||||
it "is not valid without a remote_translatable_id" do
|
||||
remote_translation.remote_translatable_id = nil
|
||||
expect(remote_translation).not_to be_valid
|
||||
end
|
||||
|
||||
it "is not valid without a remote_translatable_type" do
|
||||
remote_translation.remote_translatable_type = nil
|
||||
expect(remote_translation).not_to be_valid
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user