Sha256: 7e731fb91b3c21e0510184c8e321a492dd1b68b2938397395a311c60c13c79cf

Contents?: true

Size: 1.48 KB

Versions: 1

Compression:

Stored size: 1.48 KB

Contents

require 'test_helper'

class UsersControllerTest < ActionController::TestCase
  test "should get custom_error_message" do
    get :custom_error_message, :lang => "ja"
    assert_html("ja/custom_error_message.html")
    assert_response :success

    get :custom_error_message, :lang => "en"
    assert_html("en/custom_error_message.html")

    # not match
    get :custom_error_message, :lang => "kr"
    assert_html("en/custom_error_message.html")

    # custom_error_message_fr.html.erb
    get :custom_error_message, :lang => "fr"
    assert_html("fr/custom_error_message.html")
  end

  test "should get custom plural error_messages" do
    get :custom_error_message, :lang => "ja", :plural => "true"
    assert_html("ja/custom_error_message_with_plural.html")
    assert_response :success

    get :custom_error_message, :lang => "en", :plural => "true"
    assert_html("en/custom_error_message_with_plural.html")

    get :custom_error_message, :lang => "fr", :plural => "true"
    assert_html("fr/custom_error_message_with_plural.html")
  end

  test "should get localized distance_of_time_in_words" do
    get :distance_of_time_in_words, :lang => "ja"
    assert_html("ja/distance_of_time_in_words.html")
    assert_response :success

    get :distance_of_time_in_words, :lang => "en"
    assert_html("en/distance_of_time_in_words.html")
    assert_response :success

    get :distance_of_time_in_words, :lang => "fr"
    assert_html("fr/distance_of_time_in_words.html")
    assert_response :success
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gettext_rails-2.0.0 test/test/functional/users_controller_test.rb