add i18n tests

This commit is contained in:
wvengen 2013-07-25 14:46:25 +02:00
parent ca50006235
commit eac8260b38
3 changed files with 26 additions and 0 deletions

View file

@ -70,6 +70,9 @@ end
group :development, :test do group :development, :test do
gem 'ruby-prof' gem 'ruby-prof'
end
group :test do
gem 'rspec-rails' gem 'rspec-rails'
gem 'factory_girl_rails', '~> 4.0' gem 'factory_girl_rails', '~> 4.0'
gem 'faker' gem 'faker'
@ -77,6 +80,10 @@ group :development, :test do
# webkit and poltergeist don't seem to work yet # webkit and poltergeist don't seem to work yet
gem 'database_cleaner' gem 'database_cleaner'
gem 'simplecov', require: false gem 'simplecov', require: false
# need to include rspec components before i18n-spec or rake fails in test environment
gem 'rspec-core'
gem 'rspec-expectations'
gem 'i18n-spec'
end end
# Gems left for backwards compatibility # Gems left for backwards compatibility

View file

@ -118,9 +118,13 @@ GEM
highline (1.6.19) highline (1.6.19)
hike (1.2.3) hike (1.2.3)
i18n (0.6.1) i18n (0.6.1)
i18n-spec (0.4.0)
iso
inherited_resources (1.3.1) inherited_resources (1.3.1)
has_scope (~> 0.5.0) has_scope (~> 0.5.0)
responders (~> 0.6) responders (~> 0.6)
iso (0.2.0)
i18n
journey (1.0.4) journey (1.0.4)
jquery-rails (2.1.3) jquery-rails (2.1.3)
railties (>= 3.1.0, < 5.0) railties (>= 3.1.0, < 5.0)
@ -324,6 +328,7 @@ DEPENDENCIES
factory_girl_rails (~> 4.0) factory_girl_rails (~> 4.0)
faker faker
haml-rails haml-rails
i18n-spec
inherited_resources inherited_resources
jquery-rails jquery-rails
kaminari kaminari
@ -336,6 +341,8 @@ DEPENDENCIES
rails (~> 3.2.9) rails (~> 3.2.9)
rails-settings-cached (= 0.2.4) rails-settings-cached (= 0.2.4)
resque resque
rspec-core
rspec-expectations
rspec-rails rspec-rails
ruby-prof ruby-prof
sass-rails (~> 3.2.3) sass-rails (~> 3.2.3)

12
spec/i18n_spec.rb Normal file
View file

@ -0,0 +1,12 @@
require 'spec_helper'
require 'i18n-spec'
Dir.glob('config/locales/*.yml').each do |locale_file|
describe "#{locale_file}" do
it_behaves_like 'a valid locale file', locale_file
# We're currently allowing both German and English as source language
# besides, we're using localeapp, so that it's ok if pull requests
# don't have this - a localapp pull will fix that right away.
#it { expect(locale_file).to be_a_subset_of 'config/locales/en.yml' }
end
end