[rspec-users] spec with user culture

Gnagno Gnagno lists at ruby-forum.com
Wed Dec 23 07:34:53 EST 2009


I solved the question concerning cucumber, I will post here the solution 
in case someone else will need it:

in my step definitions I just put:

Given /^my culture is (.+)$/ do |culture|
  header "HTTP_ACCEPT_LANGUAGE", "it-IT" if culture == 'italian'
  header "HTTP_ACCEPT_LANGUAGE", "en-GB" if culture == 'english'
  header "HTTP_ACCEPT_LANGUAGE", "fr-FR" if culture == 'french'
  header "HTTP_ACCEPT_LANGUAGE", "es-ES" if culture == 'spanish'
  header "HTTP_ACCEPT_LANGUAGE", "de-DE" if culture == 'german'
  header "HTTP_ACCEPT_LANGUAGE", "en-US" if culture == 'american'
  header "HTTP_ACCEPT_LANGUAGE", "jp-JP" if culture == 'japanese'
end

and it works :)
-- 
Posted via http://www.ruby-forum.com/.


More information about the rspec-users mailing list