Sha256: 4a67a063f63d1b78259c43b2d30bdb2fb6df3d61f236034f6ecf19c20479dee8

Contents?: true

Size: 741 Bytes

Versions: 1

Compression:

Stored size: 741 Bytes

Contents

USE_RAILS=true unless defined?(USE_RAILS)
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

describe Lolita::I18n::Backend do

  it "should have fallback to default I18n store" do
    I18n.t("Page title").should == "Page title"
  end

  it "should set translation into DB" do
    ::I18n.t("test-key", :locale => :en, :default => '').should == ''
    Lolita::I18n::Backend.set("en.test-key","Hello")
    ::I18n.t("test-key", :locale => :en, :default => '').should == 'Hello'
  end

  it "should get translation into DB" do
    Lolita::I18n::Backend.get("en.test-key")[:value].should == ''
    Lolita::I18n::Backend.set("en.test-key","Hello")
    Lolita::I18n::Backend.get("en.test-key")[:value].should == "Hello"
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
lolita-i18n-0.1.3 spec/lolita-i18n/backend_spec.rb