Permalink
Browse files

more tests

  • Loading branch information...
1 parent 2fbcc48 commit 145a1e0fb039314c832022e68f239a25ee0a8a3e @jhilden jhilden committed Mar 12, 2012
Showing with 15 additions and 2 deletions.
  1. +2 −1 test/dummy/app/views/test/test.html.erb
  2. +1 −0 test/dummy/config/locales/en.yml
  3. +12 −1 test/i18n_viz_test.rb
@@ -1 +1,2 @@
-<span><%= translate("hello") %></span>
+<span><%= t("hello") %></span>
+<span><%= translate("foo", :i18n_viz => false) %></span>
@@ -3,3 +3,4 @@
en:
hello: "Hello world"
+ foo: "bar"
View
@@ -4,17 +4,28 @@
class I18nVizIntegrationTest < ActionDispatch::IntegrationTest
test 'translate without i18n_viz url parameter' do
visit "/test"
-
+
assert !page.has_content?("--hello--")
assert !page.has_css?("#i18n_viz_tooltip")
end
test 'translate with i18n_viz url parameter' do
+ I18nViz.enabled = true
visit "/test?i18n_viz=1"
assert page.has_content?("--hello--")
assert !page.has_css?(".i18n-viz")
assert !page.has_css?("#i18n_viz_tooltip")
+
+ assert page.has_content?("bar")
+ assert !page.has_content?("--foo--")
+ end
+
+ test 'disable I18nViz' do
+ I18nViz.enabled = false
+ visit "/test?i18n_viz=1"
+
+ assert !page.has_content?("--hello--")
end
end

0 comments on commit 145a1e0

Please sign in to comment.