mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-19 08:40:12 +01:00
forgot to add these
This commit is contained in:
parent
86afd42148
commit
fde64e0b3d
145 changed files with 9044 additions and 0 deletions
33
backup.rails2.3/plugins/translate/spec/storage_spec.rb
Normal file
33
backup.rails2.3/plugins/translate/spec/storage_spec.rb
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
require File.dirname(__FILE__) + '/spec_helper'
|
||||
|
||||
describe Translate::Storage do
|
||||
describe "write_to_file" do
|
||||
before(:each) do
|
||||
@storage = Translate::Storage.new(:en)
|
||||
end
|
||||
|
||||
it "writes all I18n messages for a locale to YAML file" do
|
||||
I18n.backend.should_receive(:translations).and_return(translations)
|
||||
@storage.stub!(:file_path).and_return(file_path)
|
||||
file = mock(:file)
|
||||
file.should_receive(:write).with(translations)
|
||||
Translate::File.should_receive(:new).with(file_path).and_return(file)
|
||||
@storage.write_to_file
|
||||
end
|
||||
|
||||
def file_path
|
||||
File.join(File.dirname(__FILE__), "files", "en.yml")
|
||||
end
|
||||
|
||||
def translations
|
||||
{
|
||||
:en => {
|
||||
:article => {
|
||||
:title => "One Article"
|
||||
},
|
||||
:category => "Category"
|
||||
}
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue