Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added passing specs for unique language translations

  • Loading branch information...
commit 47c5e1ea7fe22f8debd5b57d95a687f9aee713b1 1 parent fd37d64
@snusnu authored
Showing with 16 additions and 1 deletion.
  1. +0 −1  TODO
  2. +16 −0 spec/unit/translation_spec.rb
View
1  TODO
@@ -1,3 +1,2 @@
-* Spec unique languages per translated resource
* Add accessors for the localized properties in the localizable resource
* Think about validation and null constraints
View
16 spec/unit/translation_spec.rb
@@ -0,0 +1,16 @@
+require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
+
+describe "the remixed translation resource" do
+
+ it "should store unique languages for every resource to translate" do
+ l = Language.create :code => 'en-US', :name => 'English'
+ i = Item.create
+ t1 = ItemTranslation.create(:item => i, :language => l)
+ t1.should_not be_new_record
+ t2 = ItemTranslation.create(:item => i, :language => l)
+ t2.should be_new_record
+ t2.errors.should_not be_empty
+ t2.errors.size.should == 1
+ end
+
+end
Please sign in to comment.
Something went wrong with that request. Please try again.