[rspec-users] How it would be tested?

2010-07-20 Thread tests learner
Hello all. I'm working with rails and came to a situation that i cannot imagine how to test this. Given i have an index action that retrieves me a collection of objects. But some of them have especific permissions. My index action act like this: - retrieve public objects. - retrieve permission

[rspec-users] bundle exec rspec vs rake spec

2010-07-20 Thread Jay
I'm in the process of upgrading my rails app to rails 3 and I'm getting different results from running the 2 commands above. The bundle exec rspec runs my tests correctly, but when I run rake spec it doesn't seem to do anything. I get 0 examples, 0 failures. This is on version 2.0.0.beta.17 of

[rspec-users] Event machine support

2010-07-20 Thread trung
I have a question of how rspec treat eventmachined rails app. My understanding is eventmachined is normally run within Thin, and it is Thin who initiates the event loop. So how do you test the eventmachined rails app? Do we have to modify the rspec script to initiate the event loop? Thanks.

[rspec-users] controller.should_receive(:render) problem

2010-07-20 Thread Ruprict
Hi. My issue is similar to the one in this post: http://groups.google.com/group/rspec/browse_thread/thread/973d770e45bdd6cd/8ba067476003f08f?lnk=gstq=render+controller+should_receive#8ba067476003f08f (which, btw, I could not reply to...only option was Reply to Author) where I have a RESTful

Re: [rspec-users] bundle exec rspec vs rake spec

2010-07-20 Thread David Chelimsky
On Jul 19, 2010, at 7:51 AM, Jay wrote: I'm in the process of upgrading my rails app to rails 3 and I'm getting different results from running the 2 commands above. The bundle exec rspec runs my tests correctly, but when I run rake spec it doesn't seem to do anything. I get 0 examples, 0

Re: [rspec-users] controller.should_receive(:render) problem

2010-07-20 Thread David Chelimsky
On Jul 12, 2010, at 4:18 AM, Ruprict wrote: Hi. My issue is similar to the one in this post: http://groups.google.com/group/rspec/browse_thread/thread/973d770e45bdd6cd/8ba067476003f08f?lnk=gstq=render+controller+should_receive#8ba067476003f08f (which, btw, I could not reply to...only

[rspec-users] [Rspec-Rails] before(:all) doesn't rollback

2010-07-20 Thread Bogdan Gusiev
I don't if this is a bug or feature but if before(:all) create some persistent objects, these changes doesn't rollback when we get out of the context. Here are simplest example to see the issue: describe Person do context 1 do before(:all) do Person.create!(@valid_attributes) end

Re: [rspec-users] [Rspec-Rails] before(:all) doesn't rollback

2010-07-20 Thread Craig Demyanovich
More info here http://rspec.info/documentation/before_and_after.html. Note the warning at the bottom of the page. Regards, Craig ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] How do I setup Rspec, Cucumber to test a Gem?

2010-07-20 Thread Walther Diechmann
Ben Mabey wrote: I like using jeweler to create the structure of my gems. It is like Rail's generators but for gems. Try it out: gem install jeweler jeweler my_gem --rspec --cucumber HTH, Ben not really - but thanks for offering help :) I followed the Rspec Book, railscast's on the

[rspec-users] methods not available...

2010-07-20 Thread rogerdpack
Hi all. Noticed that with rspec 1.x methods at higher levels aren't available in lower, ex: context a do def go end it should pass do go end it should pass again do context a::b do go end end end This surprised me a bit, making re-use of outer methods unavailable. Is

Re: [rspec-users] methods not available...

2010-07-20 Thread David Chelimsky
On Jul 20, 2010, at 1:07 PM, rogerdpack wrote: Hi all. Noticed that with rspec 1.x methods at higher levels aren't available in lower, ex: context a do def go end it should pass do go end it should pass again do context a::b do You can't wrap contexts inside examples.

[rspec-users] spec w/o db:test:prepare

2010-07-20 Thread Peter Fitzgibbons
HI All, I would like to perform my spec runs without the db:test:prepare rake prereq. It would be nice if I could alter spec to prereq db:test:purge only. Could you give me some advice/urls/pointers on how best to go about this? Thanks, Peter Fitzgibbons (847) 859-9550 Email:

Re: [rspec-users] spec w/o db:test:prepare

2010-07-20 Thread David Chelimsky
On Jul 20, 2010, at 4:18 PM, Peter Fitzgibbons wrote: HI All, I would like to perform my spec runs without the db:test:prepare rake prereq. It would be nice if I could alter spec to prereq db:test:purge only. Could you give me some advice/urls/pointers on how best to go about this?

Re: [rspec-users] rspec2 help output has brackets?

2010-07-20 Thread dchelim...@gmail.com
On Jul 19, 9:20 am, Wincent Colaiuta w...@wincent.com wrote: El 19/07/2010, a las 15:52, David Chelimsky escribió: On Jul 19, 2010, at 8:17 AM, rogerdpack wrote: Hi all. Saw this: Usage: rspec [options] [files or directories]   -b, --backtrace                  Enable full

Re: [rspec-users] Event machine support

2010-07-20 Thread rogerdpack
My understanding is eventmachined is normally run within Thin, and it is Thin who initiates the event loop. So how do you test the eventmachined rails app? Do we have to modify the rspec script to initiate the event loop? You could also use before(:all) do EM.start_in_other_thread end or

Re: [rspec-users] methods not available...

2010-07-20 Thread rogerdpack
 it should pass again do   context a::b do You can't wrap contexts inside examples. Cool thanks for the reply. The confusing part is that it allowed me to have that context within an example. Maybe a more explicit failure for newbies when they do this would be kind. -r