Skip to content

Commit

Permalink
fix i18n in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Floppy committed Apr 30, 2014
1 parent 77405f0 commit 5d4ea2c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
18 changes: 13 additions & 5 deletions spec/libs/travis_builds_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

describe TravisBuilds do

before :all do
Timecop.freeze(2014,02,22)
end

describe "with passing builds" do

before :all do
Expand Down Expand Up @@ -57,13 +61,13 @@
@result = TravisBuilds.update
@result[:latest].count.should == 3
@result[:latest][0][:job].should == "dashboards"
@result[:latest][0][:date].should == "2014-02-21T12:43:51Z"
@result[:latest][0][:date].should == "about 11 hours ago"
@result[:latest][0][:status].should == "success"
@result[:latest][1][:job].should == "breasal"
@result[:latest][1][:date].should == "2014-02-21T12:17:53Z"
@result[:latest][1][:status].should == "failure"
@result[:latest][1][:date].should == "about 12 hours ago"
@result[:latest][1][:status].should == "success"
@result[:latest][2][:job].should == "csvlint"
@result[:latest][2][:date].should == "2014-02-21T10:22:53Z"
@result[:latest][2][:date].should == "about 13 hours ago"
@result[:latest][2][:status].should == "disabled"
end

Expand Down Expand Up @@ -128,7 +132,7 @@
@result = TravisBuilds.update
@result[:failboat].count.should == 1
@result[:failboat][0][:job].should == "breasal"
@result[:failboat][0][:date].should == "2014-02-21T12:17:53Z"
@result[:failboat][0][:date].should == "about 12 hours ago"
@result[:failboat][0][:status].should == "failure"
end

Expand All @@ -142,4 +146,8 @@

end

after :all do
Timecop.return
end

end
5 changes: 5 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
require 'dotenv'
require 'timecop'
require 'pry'
require 'i18n'
require 'i18n/backend/fallbacks'

Dotenv.load

Expand Down Expand Up @@ -34,3 +36,6 @@
# --seed 1234
config.order = 'random'
end

I18n.load_path = Dir[File.join(File.dirname(__FILE__), '..', 'locales', '*.yml')]
I18n.backend.load_translations

0 comments on commit 5d4ea2c

Please sign in to comment.