[rspec-users] spec with user culture

Matt Wynne matt at mattwynne.net
Wed Dec 23 05:14:47 EST 2009


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 wrote this:
>
> Scenario Outline: visit home page and get redirect to localized home
> page
>  Given my culture is <culture>
>  When I go to the home page
>  Then I should be redirected to the <page>
>
>  Examples:
>    | culture   | page                  |
>    | italian   | italian_home_page     |
>    | english   | english_home_page     |
>    | french    | french_home_page      |
>    | spanish   | spanish_home_page     |
>    | german    | german_home_page      |
>    | japanese  | japanese_home_page    |
>
> but I cannot access request.env from a cucumber step, and moreover I
> think accessing to request.env from cucumber could tie it too much to
> the application, am I right?

Right. You need to ask the cukes group (or the webrat group, or the  
rails group) about how you pass HTTP headers with your in the step  
"When I go to the home page".

>
> -- 
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users

cheers,
Matt

http://mattwynne.net
+447974 430184



More information about the rspec-users mailing list