[rspec-users] Default format for all requests in a spec

2010-08-26 Thread Maurício Linhares
Hi guys, Is there a way to define a default parameter for all requests made in a spec? I have a spec where I want all requests to be made with the "js" format but I find it rather annoying to type a ":format => 'js'" on every get/post/put/delete. Is there any

Re: [rspec-users] RSpec stub/mock I18n

2009-08-20 Thread Maurício Linhares
Yes, so it's useless trying to stub it. Tools like Remarkable will let you spec that validates call in a better way -> http://github.com/carlosbrando/remarkable/ - Maurício Linhares http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr On Thu, Aug 20, 2009 at 6:07 PM, B

Re: [rspec-users] RSpec stub/mock I18n

2009-08-20 Thread Maurício Linhares
When you spec runs (and your stub! is called) the method has already been called, so your stub will never catch anything. - Maurício Linhares http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr On Thu, Aug 20, 2009 at 5:03 PM, BallaBall wrote: > I have some model with

Re: [rspec-users] Autospec Infinite Loop ??

2009-06-12 Thread Maurício Linhares
Same for me. - Maurício Linhares http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr On Fri, Jun 12, 2009 at 10:59 AM, Bart Zonneveld wrote: > > On 12 jun 2009, at 13:42, Alexandre Da Silva wrote: > >> Jarmo Pertman wrote: >>> >>> Do you have

[rspec-users] Given/When/Then blocks on Cucumber

2009-06-05 Thread Maurício Linhares
we would do with Cucumber Scenario: Searching for Hello World Given I go to "http://www.google.com"; When I fill "q" textbox with "Hello World" When I click "btnG" button Then I see "Hello World - Google Search" title With cucumber we n

Re: [rspec-users] [ANN] At last, the book

2009-01-29 Thread Maurício Linhares
No, you're not ;P Hope it's really launched in April \o/ - Maurício Linhares http://alinhavado.wordpress.com/ (pt-br) | http://blog.codevader.com/ (en) On Thu, Jan 29, 2009 at 12:10 PM, Juanma Cervera wrote: > I have just gone to "Pragmatic Programmers" and spent m

Re: [rspec-users] eql not matching identical hashes unless they actually are the same object

2009-01-14 Thread Maurício Linhares
"eql?" matches object references, you should use "==" to match equality. - Maurício Linhares http://alinhavado.wordpress.com/ (pt-br) | http://blog.codevader.com/ (en) On Thu, Jan 8, 2009 at 1:26 PM, Leandro Pedroni wrote: > rspec 1.1.11 and it's rails sidekick. &

Re: [rspec-users] Why can not a BigDecimal be compared to a Float via "==". How should I handle this???

2009-01-11 Thread Maurício Linhares
This is a very bad idea, as you can break the whole runtime by doing this, as many internal classes use floating point math. You would also slow the world down, as operations using BigDecimals are some order of magnitude slower than pure floating point math. - Maurício Linhares http

Re: [rspec-users] Cucumber: dependencies.rb:266:in `load_missing_constant': uninitialized constant Dispatcher

2008-12-23 Thread Maurício Linhares
Also, the name isn't Dispatcher anymore, it's ActionController::Dispatcher. - Maurício Linhares http://alinhavado.wordpress.com/ (pt-br) | http://blog.codevader.com/ (en) On Tue, Dec 23, 2008 at 7:26 PM, Mischa Fierer wrote: > from > /opt/local/lib/ruby/gems/1.8/gems/cuc

Re: [rspec-users] Cucumber: dependencies.rb:266:in `load_missing_constant': uninitialized constant Dispatcher

2008-12-23 Thread Maurício Linhares
ct (with a vendored rails 2.2.2) it just doesn't work. And only in testing, the application itself runs completely fine. - Maurício Linhares http://alinhavado.wordpress.com/ (pt-br) | http://blog.codevader.com/ (en) ___ rspec-users mailing list rspec-use

Re: [rspec-users] Cucumber: dependencies.rb:266:in `load_missing_constant': uninitialized constant Dispatcher

2008-12-23 Thread Maurício Linhares
I had a problem just like this with "has_many_polymorphs" and it was a bad require ( it was requiring "dispatcher" when it should be requiring "action_controller/dispatcher") Maybe a "require 'action_controller/dispatcher'"

[rspec-users] Undefined method "full_description" when trying to run "rake spec"

2008-12-01 Thread Maurício Linhares
the same gems installed in the app as plugins. My machine is a "Linux linux-fof0 2.6.25.18-0.2-default #1 SMP 2008-10-21 16:30:26 +0200 x86_64 x86_64 x86_64 GNU/Linux " - Maurício Linhares http://alinhavado.wordpress.com/ (pt-br) | http://blog.codevader.com/ (en) _

Re: [rspec-users] Design Pattern proposal for better Rails development

2008-11-05 Thread Maurício Linhares
;t this making your controller code ugly? Do you have any samples of this to exemplify what you're doing? - Maurício Linhares http://alinhavado.wordpress.com/ (pt-br) | http://blog.codevader.com/ (en) João Pessoa, PB, +55 83 8867-7208 On Wed, Nov 5, 2008 at 12:44 PM, David Chelimsky <[EMA

Re: [rspec-users] Setting instance variables for controllers

2008-09-03 Thread Maurício Linhares
ssible to do? > > I thought that controller.set_instance_variable( :@user, ... ) would do the > trick but it does not seem to work. > > Thank you! > -- > View this message in context: > http://www.nabble.com/Setting-instance-variables-for-controllers-tp19283500p19283500.

Re: [rspec-users] failing before :all doesn't move progress bar in html reports

2008-08-19 Thread Maurício Linhares
tmlformatter by adding these lines into > example_failed method prior invoking super: > > def example_failed example, counter, failure > > # > #some other stuff > # > >if example.description == "before(:all)" > @example_number += > @options.example

Re: [rspec-users] find_all_by returning nil

2008-08-11 Thread Maurício Linhares
culprit. It should be stub!(find... instead of stub(!find > > Regards, > Craig -- Maurício Linhares http://alinhavado.wordpress.com/ (pt-br) | http://blog.codevader.com/ (en) João Pessoa, PB, +55 83 8867-7208 ___ rspec-users mailing list

Re: [rspec-users] [HELP] should receive :new but does not

2008-07-22 Thread Maurício Linhares
; > 1) > Spec::Mocks::MockExpectationError in 'IssuesController when saving > wrong data should not save the issue' > Mock 'Issue_1001' expected :save with (any args) once, but received it 0 times > spec/controllers/issues_controler_spec.rb:51: > spec/

Re: [rspec-users] Errors in controller test

2008-07-20 Thread Maurício Linhares
rors-in-controller-test-tp18358354p18358354.html > Sent from the rspec-users mailing list archive at Nabble.com. > > ___ > rspec-users mailing list > rspec-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users > -- Maurício Linhares http://alinhavado.wordpress.com/ (pt-br) | http://blog.codevader.com/ (en) João Pessoa, PB, +55 83 8867-7208 ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Testing routes

2008-06-19 Thread Maurício Linhares
:action=>"prices"} > ./spec/controllers/books_controller_spec.rb:5: > > I've tried many different alternatives for get, but they always end up with > the same error. I'm surely missing something. Any help would be > appreciated. > > Thanks > &g

[rspec-users] rcov causing a segmentation fault on rspec 1.1.4 and rails 2.1

2008-06-07 Thread Maurício Linhares
rcov 0.8.1.2.0, rails 2.1 and Ubuntu Linux 8.4. -- Maurício Linhares http://alinhavado.wordpress.com/ (pt-br) | http://blog.codevader.com/ (en) João Pessoa, PB, +55 83 8867-7208 ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/m

Re: [rspec-users] Match render :nothing

2008-06-07 Thread Maurício Linhares
t; I'm pretty sure you can do > response.body.should be_blank # or == "" > > If you don't like how it reads, you could create a custom > render_nothing matcher. > > Pat -- Maurício Linhares http://alinhavado.

[rspec-users] Match render :nothing

2008-06-07 Thread Maurício Linhares
Hello guys, Is there any way to match a render :nothing? I coudn't find any way to do this so i've just changed my controllers to do a "head :ok", but it would be nice to know if there is any other way :) -- Maurício Linhares http://alinhavado.wordpress.com/ (pt-br) | http:

Re: [rspec-users] When to send "post" and "get" in blocks.

2008-06-06 Thread Maurício Linhares
line that contains "should"), but other times, the order > is the opposite. > In the third spec above, the sentence that has "should" comes first and > do_get later. In my view, "get :index" needs to be done first to trigg

Re: [rspec-users] How to write a test for validates_uniqueness_of

2008-05-20 Thread Maurício Linhares
create(:username => "mike") > @another.save.should be_false > > This messes up test database. Is there any better way? > > -T > _______ > rspec-users mailing list > rspec-users@rubyforge.org > http://rubyforge.org/mailman

Re: [rspec-users] bad specs better than none?

2008-02-27 Thread Maurício Linhares
nd also that specs that access databases run slower than "pure" unit tests, but you can't be sure that your app works without a bunch of integration tests. -- Maurício Linhares http://alinhavado.wordpress.com/ (pt-br) | http://codeshooter.wordpress.com/ (en) João Pessoa, PB, +55

Re: [rspec-users] Problems with redirect_to

2008-02-22 Thread Maurício Linhares
to( :action => 'show', :id => @static_page.permalink ) end -- Maurício Linhares http://alinhavado.wordpress.com/ (pt-br) | http://codeshooter.wordpress.com/ (en) João Pessoa, PB, +55 83 8867-7208 On Fri, Feb 22, 2008 at 11:25 AM, David Chelimsky <[EMAIL PROTECTED]> wro

Re: [rspec-users] Problems with redirect_to

2008-02-22 Thread Maurício Linhares
lugins/rspec/lib/spec/runner/example_group_runner.rb:21:in `run' /home/mauricio/workspace/antares/vendor/plugins/rspec/lib/spec/runner/options.rb:90:in `run_examples' /home/mauricio/workspace/antares/vendor/plugins/rspec/lib/spec/runner/command_line.rb:19:in `run' script/spec:4: On Fri, Feb

[rspec-users] Problems with redirect_to

2008-02-22 Thread Maurício Linhares
elete requests are allowed. ./spec/controllers/static_pages_controller_spec.rb:118: script/spec:4: So, the response is a redirect (the "response.should be_redirect" passes) but when i try to be sure that it redirected to the right page it throws this weird error to me. Any ideas about what I've done