Sha256: 062ec4821662f9137ab52c768021cb415a6a909fae8598102f234b099105fea3

Contents?: true

Size: 909 Bytes

Versions: 3

Compression:

Stored size: 909 Bytes

Contents

# coding: utf-8

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

include Lolita::Test::Matchers

describe Lolita::I18nController do
  render_views

  it "should have i18n routes" do
    {:get=>"/lolita/i18n"}.should be_routable
    {:put=>"/lolita/i18n/1"}.should be_routable
    {:put=>"/lolita/i18n/translate_untranslated"}.should be_routable
    {:get=>"/lolita/i18n"}.should be_routable
  end

  it "should show all translations" do
    get :index
    response.should render_template("index")
    response.body.should match(/#{::I18n.t('lolita-i18n.title')}/)
  end

  it "should save translation" do
    put :update, :id=>"en.Page title",:translation=>"New title", :format => :json
    response.body.should == {error: false}.to_json
    ::I18n.t("Page title", :locale => :en).should == "New title"
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
lolita-i18n-0.3.2 spec/controllers/lolita/i18n_controller_spec.rb
lolita-i18n-0.3.1 spec/controllers/lolita/i18n_controller_spec.rb
lolita-i18n-0.3.0 spec/controllers/lolita/i18n_controller_spec.rb