Skip to content

Commit

Permalink
Fix setting expected value in translation tests
Browse files Browse the repository at this point in the history
It was being set to nil instead due to the wrong assignment.
  • Loading branch information
carlosantoniodasilva committed Jan 21, 2013
1 parent e4dbfce commit 57b65ef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions actionpack/test/abstract/translation_test.rb
Expand Up @@ -29,13 +29,13 @@ def test_action_controller_base_responds_to_l


def test_lazy_lookup def test_lazy_lookup
expected = 'bar' expected = 'bar'
@controller.stubs(:action_name => :index) @controller.stubs(action_name: :index)
I18n.stubs(:translate).with('abstract_controller.testing.translation.index.foo').returns(expected) I18n.stubs(:translate).with('abstract_controller.testing.translation.index.foo').returns(expected)
assert_equal expected, @controller.t('.foo') assert_equal expected, @controller.t('.foo')
end end


def test_default_translation def test_default_translation
key, expected = 'one.two' 'bar' key, expected = 'one.two', 'bar'
I18n.stubs(:translate).with(key).returns(expected) I18n.stubs(:translate).with(key).returns(expected)
assert_equal expected, @controller.t(key) assert_equal expected, @controller.t(key)
end end
Expand Down

0 comments on commit 57b65ef

Please sign in to comment.