Re: [rspec-users] Testing layouts with RSpec on Rails

2007-10-22 Thread Steve
On Mon, 22 Oct 2007 20:06:50 -0500, David Chelimsky wrote: It would feel even less hackish if render supported :text like rails render does. So you could do this: render :text = 'divyielded/div', :layout = 'application' response.should have_tag('div', 'yielded') Good idea. Feature request

[rspec-users] View spec response has no content?

2007-10-21 Thread Steve
I have been messing with this all night, and can't figure out what's going wrong here. I have a test that renders the view, and then a shared behavior checks response for the various tags from a rails layout. The problem is matching. If I run in the browser the page renders fine. Is there a way to

Re: [rspec-users] View spec response has no content?

2007-10-21 Thread Steve
On Mon, 22 Oct 2007 02:49:59 +, Steve wrote: I have been messing with this all night, and can't figure out what's going wrong here. I have a test that renders the view, and then a shared behavior checks response for the various tags from a rails layout. The problem is matching. If I run

Re: [rspec-users] Testing layouts with RSpec on Rails

2007-10-21 Thread Steve
* beneficial capability to have for making sure views work as expected. Thanks, Steve ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

[rspec-users] Pending should_receive shows as FIXED

2007-10-21 Thread Steve
than its enclosing pending block. Steve ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] spec:models depends on development db:migration

2007-10-18 Thread Steve
On Thu, 18 Oct 2007 15:51:37 +0100, Keith McDonnell wrote: For those interested rake spec:models seems to clone the test database from development. If your dev db is empty, the models task fails mysteriously. Anyway, to make sure your dev db is at the current migration version, I

Re: [rspec-users] spec:models depends on development db:migration

2007-10-18 Thread Steve
On Thu, 18 Oct 2007 11:30:03 -0500, David Chelimsky wrote: Yeah, I was just about to post about this. This seems like incorrect behavior. Especially if you're really doing behavior driven design. You're going to be writing your tests and using the test environment first before you actually go

Re: [rspec-users] rspec causing validates_presence_of to validate twice?

2007-10-17 Thread Steve
On Wed, 17 Oct 2007 15:05:01 -0500, David Chelimsky wrote: Versions? RSpec? Rails? Details details. :) rspec/rspec_on_rails(trunk): r2717 rails(trunk): r7822 ___ rspec-users mailing list rspec-users@rubyforge.org

Re: [rspec-users] rspec causing validates_presence_of to validate twice?

2007-10-17 Thread Steve
On Wed, 17 Oct 2007 15:41:19 -0500, David Chelimsky wrote: Please update to the latest rspec trunk and try again. I think this is due to a bug that was resolved in the 2718 (believe it or not). Just updated and am at 2719. The problem still happens.

Re: [rspec-users] rspec causing validates_presence_of to validate twice?

2007-10-17 Thread Steve
On Wed, 17 Oct 2007 16:17:53 -0500, David Chelimsky wrote: Thanks for trying. Sorry it's still a problem. How are you running the specs (rake? spec command? textmate?) and what precisely is the error that you get? Please include a stack trace (not just one line) Thanks, David I'm

Re: [rspec-users] rspec causing validates_presence_of to validate twice?

2007-10-17 Thread Steve
On Wed, 17 Oct 2007 18:01:11 -0500, David Chelimsky wrote: One more thing to try. Open up spec/spec.opts and remove the line that says --reverse if it's there. Then run rake spec again and see what happens. Thanks, David Removing --reverse makes rake spec fail like the other two methods

Re: [rspec-users] rspec causing validates_presence_of to validate twice?

2007-10-17 Thread Steve
On Wed, 17 Oct 2007 19:30:57 -0500, David Chelimsky wrote: Removing --reverse makes rake spec fail like the other two methods now. That's what I suspected would happen. The reason they were failing differently was that rake was running them in the opposite order. Removing --reverse made

Re: [rspec-users] rspec causing validates_presence_of to validate twice?

2007-10-17 Thread Steve
On Wed, 17 Oct 2007 21:31:19 -0500, David Chelimsky wrote: This all may be true but I can't help you diagnose the problem without looking at the code. If you'd kindly pastie the spec and model, I'll be glad to look at them. Otherwise I'm just guessing and that's not working out to well so

Re: [rspec-users] Named routes in controller not working?

2007-10-16 Thread Steve
On Tue, 16 Oct 2007 06:45:53 +, Steve wrote: I have some redirect_tos using named routes in a controller that work fine in the browser, but choke my tests. The route in question is new_session and comes from a map.resource :session, :controller = :session route mapping. If I replace

[rspec-users] Spec dirs not in path?

2007-10-16 Thread Steve
I'm just curious if there's a reason why rspec doesn't add the various spec dirs to $: so that requires can be done without specifying the full path name. Thanks, Steve ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman

Re: [rspec-users] Spec dirs not in path?

2007-10-16 Thread Steve
On Tue, 16 Oct 2007 14:17:48 -0500, David Chelimsky wrote: Do you mean the dirs inside rspec, or in the spec directory in your project? Inside the spec dir in the project. spec/controllers, spec/models, etc... ___ rspec-users mailing list

[rspec-users] Example for attr_accessible?

2007-10-15 Thread Steve
been set properly. Would it be possible to mock or some such to check for a call to attr_accessible? Thanks, Steve ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] generate script_controller not creating test code

2007-10-15 Thread Steve
if there is something that I did incorrectly or not. Does anyone know why this is happening? Thanks Did you do generate rspec_controller or generate script_controller like the subject indicates? Steve ___ rspec-users mailing list rspec-users@rubyforge.org http

[rspec-users] Failure trying to test ApplicationController

2007-10-15 Thread Steve
if User.current.logged_in? redirect_to :controller = account, :action = logon and return false end The line it's failing on is the redirect_to in require_login. What am I doing wrong? Thanks, Steve ___ rspec-users mailing list rspec-users@rubyforge.org http

Re: [rspec-users] Failure trying to test ApplicationController

2007-10-15 Thread Steve
On Mon, 15 Oct 2007 23:46:32 -0500, David Chelimsky wrote: On 10/15/07, Steve [EMAIL PROTECTED] wrote: I'm trying to write some tests for the ApplicationController as shared tests that can be run in all of my other controller tests, but am getting a nil.rewrite error. Below is what I have

[rspec-users] Note on Rails 2.0 Preview

2007-10-02 Thread Steve Ross (CWD)
Make sure you get a relatively current version of rspec or you will get: /Users/me/rails/ubb/vendor/rails/activerecord/lib/../../activesupport/ lib/active_support/dependencies.rb:263:in `load_missing_constant': uninitialized constant ActionView::Helpers::JavaScriptMacrosHelper (NameError)

[rspec-users] ActsAsList specs

2007-08-15 Thread Steve Tooke
? Any thoughts on how I can improve this? How anyone else has done this? Cheers, Steve ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

[rspec-users] ActiveRecordAssociationMatcher

2007-08-10 Thread Steve Tooke
I've started to put together a custom expectation matcher for specifying AR associations. Its not quite complete and I really need to put some specs together for it, but I'd appreciate any comments. It lets you spec your associations like this: describe Record do include

<    1   2