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
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
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
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 :
Hello Folks,
This gist http://gist.github.com/261791 has an example user.rb, user_spec.rb
At runtime, this snippet fails
u = User.find(123)
u.update_with_profile({...})
The error occurred while evaluating nil.select):
app/models/user.rb:6:in `moderator_fields'
app/models/user.rb:118:in `updat
On Tue, Dec 22, 2009 at 9:14 AM, Peter Fitzgibbons <
peter.fitzgibb...@gmail.com> wrote:
> Hello Folks,
>
> This gist http://gist.github.com/261791 has an example user.rb,
> user_spec.rb
> At runtime, this snippet fails
>
> u = User.find(123)
> u.update_with_profile({...})
> The error occurred whi
On Tue, Dec 22, 2009 at 9:22 AM, David Chelimsky wrote:
>
>
> On Tue, Dec 22, 2009 at 9:14 AM, Peter Fitzgibbons <
> peter.fitzgibb...@gmail.com> wrote:
>
>> Hello Folks,
>>
>> This gist http://gist.github.com/261791 has an example user.rb,
>> user_spec.rb
>> At runtime, this snippet fails
>>
>> u
On Tue, Dec 22, 2009 at 10:24 AM, David Chelimsky wrote:
>
>
> On Tue, Dec 22, 2009 at 9:22 AM, David Chelimsky
> wrote:
>>
>>
>> On Tue, Dec 22, 2009 at 9:14 AM, Peter Fitzgibbons
>> wrote:
>>>
>>> Hello Folks,
>>>
>>> This gist http://gist.github.com/261791 has an example user.rb,
>>> user_spe
> raise_error already catches any type of exception, error or not:
>
> class BlahException < Exception; end
> class BlahError < StandardError; end
>
> lambda { raise BlahException }.should raise_error(BlahException)
> lambda { raise BlahError }.should raise_error(BlahError)
> lambda { rai
Forgive me if the question is a common one...
does rspec have any concept like
given "a certain set of paths" do
it "should be able to recreate them" do; end
it "..."; end
end
?
Thanks.
-r
___
rspec-users mailing list
rspec-users@rubyforge.org
htt
On Tue, Dec 22, 2009 at 9:30 AM, Rick DeNatale wrote:
> Also counting on class variables to retain state in Rails is a recipe
> for disaster.
>
Did you read that in rails recipes?
:-/
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyfo
On Tue, Dec 22, 2009 at 9:35 AM, rogerdpack wrote:
> Forgive me if the question is a common one...
>
> does rspec have any concept like
>
> given "a certain set of paths" do
>
> it "should be able to recreate them" do; end
> it "..."; end
> end
>
Not built into rspec. There is a merb extension
On Tue, Dec 22, 2009 at 10:38 AM, David Chelimsky wrote:
> On Tue, Dec 22, 2009 at 9:35 AM, rogerdpack wrote:
>>
>> Forgive me if the question is a common one...
>>
>> does rspec have any concept like
>>
>> given "a certain set of paths" do
>>
>> it "should be able to recreate them" do; end
>>
On Tue, Dec 22, 2009 at 10:15 AM, Rick DeNatale wrote:
> On Tue, Dec 22, 2009 at 10:38 AM, David Chelimsky
> wrote:
> > On Tue, Dec 22, 2009 at 9:35 AM, rogerdpack
> wrote:
> >>
> >> Forgive me if the question is a common one...
> >>
> >> does rspec have any concept like
> >>
> >> given "a certa
> context "given a certain set of paths" do
Ahh so it's called context.
Cool (though I'll admit that naming it "given" can make it sound more
like an English sentence, so an alias would be a suggestion).
Much thanks.
-r
___
rspec-users mailing list
rs
On Tue, Dec 22, 2009 at 10:31 AM, rogerdpack wrote:
>
> > context "given a certain set of paths" do
>
> Ahh so it's called context.
>
> Cool (though I'll admit that naming it "given" can make it sound more
> like an English sentence, so an alias would be a suggestion).
>
http://gist.github.com/20
DOH!
Thanks David,
Happy Holidays!
Peter Fitzgibbons
(847) 687-7646
Email: peter.fitzgibb...@gmail.com
IM GTalk: peter.fitzgibbons
IM AOL: peter.fitzgibb...@gmail.com
On Tue, Dec 22, 2009 at 9:24 AM, David Chelimsky wrote:
>
>
> On Tue, Dec 22, 2009 at 9:22 AM, David Chelimsky wrote:
>
>>
>>
>
On Tue, Dec 22, 2009 at 9:33 AM, rogerdpack wrote:
> > raise_error already catches any type of exception, error or not:
> >
> > class BlahException < Exception; end
> > class BlahError < StandardError; end
> >
> > lambda { raise BlahException }.should raise_error(BlahException)
> > lambda
18 matches
Mail list logo