Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 6813c6663a
Fetching contributors…

Cannot retrieve contributors at this time

29 lines (24 sloc) 0.909 kb
require 'spec_helper'
describe Spree::Taxonomy do
let(:taxonomy) { Factory(:taxonomy, :name => "Man") }
let(:root) { taxonomy.root }
it "root taxon should set translated name" do
root.name.should == "Man"
root.name_fr.should == "Man" #I18n fallback
taxonomy.update_attributes(:name_fr => "Homme")
root.name.should == "Man"
root.name_fr.should == "Homme"
end
describe "#attrs_translations_for" do
it "returns an hash of attributes" do
taxonomy.update_attributes(:name_fr => "Homme")
taxonomy.attrs_translations_for(:name).should == {:name_en => "Man", :name_fr => "Homme"}
end
end
describe "#translations_for" do
it "returns an array of attributes" do
taxonomy.update_attributes(:name_fr => "Homme")
taxonomy.translations_for(:name).should == [{ :name => "Man", :locale => :en }, { :name => "Homme", :locale => :fr }]
end
end
end
Jump to Line
Something went wrong with that request. Please try again.