Re: [rspec-users] spec with user culture

2009-12-23 Thread Gnagno Gnagno
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 cu

Re: [rspec-users] spec with user culture

2009-12-23 Thread Matt Wynne
On 23 Dec 2009, at 10:07, Gnagno Gnagno wrote: Sorry, I have one more question, I didn't find the cucumber forum, so please forgive me if I am too much out of topic here. http://wiki.github.com/aslakhellesoy/cucumber/get-in-touch I was trying to achieve the same with cucumber, so I wrot

Re: [rspec-users] spec with user culture

2009-12-23 Thread Gnagno Gnagno
Sorry, I have one more question, I didn't find the cucumber forum, so please forgive me if I am too much out of topic here. I was trying to achieve the same with cucumber, so I wrote this: Scenario Outline: visit home page and get redirect to localized home page Given my culture is When I

Re: [rspec-users] spec with user culture

2009-12-23 Thread Gnagno Gnagno
Thank you very much :) I didn't know I could access request.env['HTTP_ACCEPT_LANGUAGE'] in writing, and didn't even try it -- Posted via http://www.ruby-forum.com/. ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/lis

Re: [rspec-users] spec with user culture

2009-12-22 Thread David Chelimsky
On Tue, Dec 22, 2009 at 8:25 AM, Gnagno Gnagno wrote: > Tom Stuart wrote: > > How does the application detect the user's "culture"? > > > > Cheers, > > -Tom > > Thanks for your reply Tom, > > in my home controller I have a line like this for each language: > redirect_to localized_home_page_path :

Re: [rspec-users] spec with user culture

2009-12-22 Thread Gnagno Gnagno
Tom Stuart wrote: > How does the application detect the user's "culture"? > > Cheers, > -Tom Thanks for your reply Tom, in my home controller I have a line like this for each language: redirect_to localized_home_page_path :culture => 'es' and return if request.env['HTTP_ACCEPT_LANGUAGE'].includ

Re: [rspec-users] spec with user culture

2009-12-22 Thread Tom Stuart
On 22 Dec 2009, at 11:26, Gnagno Gnagno wrote: > it "should redirect to spanish home page" do > get 'index' > #don't know how to say the culture is spanish > response.should redirect_to(spanish_home_page) > end How does the application detect the user's "culture"? Cheers, -Tom

[rspec-users] spec with user culture

2009-12-22 Thread Gnagno Gnagno
Hello all, I am making my first experiments with rspec, I wanted to do something like this: when a user visit the home page of my site he will be redirected depending on his culture, so if his culture is english he will be redirected to myapp/en if he is italian to myapp/it and so on how can