Re: [rspec-users] passing a hash in stories

2008-08-08 Thread Jonathan Linowes
Thanks, I'll give the snippet a try. My intent is not to pass the hash to the post directly, but to fill form fields using webrat. Just i want a resusable step for filling out the form with different values. Similarly I'll use the hash parser for checking row cells in a list view, etc On

[rspec-users] template.expect_render fails when partial is rendered from a helper

2008-08-08 Thread J2M
My spec; describe 'subnav rendering while logged in' do before do template.stub!(:logged_in?).and_return(true) template.stub! (:current_profile).at_least(:once).and_return(mock_profile) end def do_render render "/homepages/show.html.erb" end it "should re

Re: [rspec-users] Someone please name this matcher for me

2008-08-08 Thread Jay Levitt
Zach Dennis wrote: [1, 2, 3, 4, 1].should consist_of([1, 3, 1, 4, 2]) +1 ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] passing a hash in stories

2008-08-08 Thread Ben Mabey
Jonathan Linowes wrote: Hi, Anyone have code you could share that lets you pass a hash in plain text stories, for example Then I fill out form with name: Jon, email: [EMAIL PROTECTED], age: 9 passes in a hash { 'name' => 'Jon', 'emal' => '[EMAIL PROTECTED]', 'age' => '9' } ___

Re: [rspec-users] Can't test for page content after a redirect

2008-08-08 Thread Christian Lescuyer
Thanks Zach! It worked like a charm. Finally I used: Scenario: User enters a bookmark URL When the user adds 'http://www.gotapi.com/rubyrails' as a bookmark Then the database should have a bookmark with url 'http://www.gotapi.com/rubyrails' And the page should contain 'http://www.

Re: [rspec-users] Do you remember RSpactor?

2008-08-08 Thread Mark Wilden
I've been using RSpactor (the gem version, not the GUI) fairly happily for a month or so. However, when trying the GUI version out, it became clear that RSpactor loads things differently than 'rake spec'. Today, using the gem version, I found that I get a MissingSourceFile trying to require json. '

Re: [rspec-users] Someone please name this matcher for me

2008-08-08 Thread Dhruv Bansal
i wrote this matcher myself for a project i'm working on and have been calling it `equals_without_regard_to_order'. it's an unwieldy name and i've never really been comfortable with it but i've continued to use it, mostly because i'm dim. very curious to find a winning replacement on this list!

Re: [rspec-users] Someone please name this matcher for me

2008-08-08 Thread Mark Wilden
is_permutation_of would be technically correct, but it doesn't really express equality to me, which is the intent of the match. ///ark ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Do you remember RSpactor?

2008-08-08 Thread Jay Levitt
Andreas Wolff wrote: It took me a while to get the next release out, but I finally managed to release RSpactor 0.9.16, a Mac OS X RSpec runner. There are no new features but RSpactor should be a lot more stable and responsive now. If you want to have a look and download: http://rubyphunk.com/

Re: [rspec-users] Straw Poll: How are you using plain text stories (in rails)?

2008-08-08 Thread Jay Levitt
Matt Wynne wrote: Hi all, What originally attracted me to rspec was hearing Dan North talk about the plain text stories, and I had some fun in my previous life as a C# programmer using them to drive watir tests of an ASP.NET app. What I'm not sure about is how they're most appropriately used i

[rspec-users] RSpactor: Black is the new green?

2008-08-08 Thread Jay Levitt
Andreas Wolff wrote: It took me a while to get the next release out, but I finally managed to release RSpactor 0.9.16, a Mac OS X RSpec runner. There are no new features but RSpactor should be a lot more stable and responsive now. If you want to have a look and download: http://rubyphunk.com/

[rspec-users] passing a hash in stories

2008-08-08 Thread Jonathan Linowes
Hi, Anyone have code you could share that lets you pass a hash in plain text stories, for example Then I fill out form with name: Jon, email: [EMAIL PROTECTED], age: 9 passes in a hash { 'name' => 'Jon', 'emal' => '[EMAIL PROTECTED]', 'age' => '9' } __

[rspec-users] Stories run with "ruby", not "spec"

2008-08-08 Thread Jay Levitt
Since there's no real documentation for stories yet, and since none of the blog posts about it ever show it being run, I thought some other newbie might find this useful information when they're Googling: You don't run RSpec stories with spec! You run them with ruby. For instance, in Ben Mabe

Re: [rspec-users] embedding variable in a regex

2008-08-08 Thread Zach Dennis
On Fri, Aug 8, 2008 at 10:18 AM, aidy lewis <[EMAIL PROTECTED]> wrote: > Given /a (PROGRAM|PROGRAMMES) title of '$title'/ do |title| > > end > > Could anyone give me the correct syntax for embedding this variable in a > regex? You'll need to create a sub-expression capturing the title.

Re: [rspec-users] HTML Story Formatter

2008-08-08 Thread Joseph Wilk
Hello, Hope you had a nice break David. I've been thinking about hidden backtraces in the html stories some more and I think having them carries little to no impact for the non-tech consumers of the stories. I think its similar to how we use Nagios. The business like to look at the nice red a

[rspec-users] embedding variable in a regex

2008-08-08 Thread aidy lewis
Given /a (PROGRAM|PROGRAMMES) title of '$title'/ do |title| end Could anyone give me the correct syntax for embedding this variable in a regex? Aidy ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinf