Sha256: 0908cce33d53d5afb5110a09569e2bb2e6559b2131ec09adf4d0a3e6a1e55d69

Contents?: true

Size: 937 Bytes

Versions: 1

Compression:

Stored size: 937 Bytes

Contents

# encoding: utf-8
require File.expand_path("test_helper", File.dirname(__FILE__))

class UrlsOverwritingTest < ActionController::TestCase

  def teardown
    ::I18n.locale = ::I18n.default_locale
  end

  test "root" do
    assert_generates("/", :controller => "main", :action => "index")
    ::I18n.locale = :en
    assert_generates("/", :controller => "main", :action => "index")
    ::I18n.locale = :ru
    assert_generates("/", :controller => "main", :action => "index", :locale => false)
    assert_generates("/", :controller => "main", :action => "index", :locale => :en)
    assert_generates("/", :controller => "main", :action => "index", :locale => "en")
    assert_generates("/ru/", :controller => "main", :action => "index")
  end

  test "incorrect locale" do
    assert_raises Rails::Localization::UnknownLocaleError do
      assert_generates("/", :controller => "main", :action => "index", :locale => :de)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rails-localization-0.1.1 test/urls_overwriting_test.rb