diff options
Diffstat (limited to 'spec')
4 files changed, 28 insertions, 3 deletions
diff --git a/spec/controllers/help_controller_spec.rb b/spec/controllers/help_controller_spec.rb index 0f6f75eb9..c47e1abd3 100644 --- a/spec/controllers/help_controller_spec.rb +++ b/spec/controllers/help_controller_spec.rb @@ -1,8 +1,9 @@ +# -*- coding: utf-8 -*- require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') describe HelpController, "when using help" do render_views - + it "shows the about page" do get :about end @@ -12,7 +13,7 @@ describe HelpController, "when using help" do end it "sends a contact message" do - post :contact, { :contact => { + post :contact, { :contact => { :name => "Vinny Vanilli", :email => "vinny@localhost", :subject => "Why do I have such an ace name?", @@ -27,5 +28,27 @@ describe HelpController, "when using help" do deliveries.clear end + describe 'when requesting a page in a supported locale ' do + + before do + # Allow us to supply the locale manually + RoutingFilter.active = false + # Prepend our fixture templates + fixture_theme_path = File.join(Rails.root, 'spec', 'fixtures', 'theme_views', 'theme_one') + controller.prepend_view_path fixture_theme_path + end + + after do + RoutingFilter.active = true + end + + it 'should render the locale-specific template if available' do + get :contact, {:locale => 'es'} + response.body.should match('contáctenos theme one') + end + + end + + end diff --git a/spec/fixtures/theme_views/theme_one/help/contact.es.html.erb b/spec/fixtures/theme_views/theme_one/help/contact.es.html.erb new file mode 100644 index 000000000..a294c8aa1 --- /dev/null +++ b/spec/fixtures/theme_views/theme_one/help/contact.es.html.erb @@ -0,0 +1 @@ +contáctenos theme one diff --git a/spec/fixtures/theme_views/theme_one/help/contact.html.erb b/spec/fixtures/theme_views/theme_one/help/contact.html.erb new file mode 100644 index 000000000..428c7368d --- /dev/null +++ b/spec/fixtures/theme_views/theme_one/help/contact.html.erb @@ -0,0 +1 @@ +Contact us diff --git a/spec/lib/mail_handler/mail_handler_spec.rb b/spec/lib/mail_handler/mail_handler_spec.rb index 272b56d0b..d6e7ba5d2 100644 --- a/spec/lib/mail_handler/mail_handler_spec.rb +++ b/spec/lib/mail_handler/mail_handler_spec.rb @@ -223,7 +223,7 @@ describe 'when deriving a name, email and formatted address from a message from it 'should quote a name with quotes in it' do should_render_from_address('"FOI \" Person" <foiperson@localhost>', - ['FOI " Person', + ['FOI \" Person', 'foiperson@localhost', '"FOI \" Person" <foiperson@localhost>']) end |