Re: [rspec-users] Specifying a few valid values

2008-07-21 Thread Bart Zonneveld
On 18-jul-2008, at 1:22, David Chelimsky wrote: On Thu, Jul 17, 2008 at 11:04 AM, Jonathan Leighton [EMAIL PROTECTED] wrote: On Thu, 2008-07-17 at 09:40 -0500, David Chelimsky wrote: On Thu, Jul 17, 2008 at 9:37 AM, Zach Dennis [EMAIL PROTECTED] wrote: Perhaps... When I login with

[rspec-users] Specifying a few valid values

2008-07-17 Thread Jonathan Leighton
I have a Rails spec where I want to check that the action_name is either create or update. I can think of a couple of ways to do it, but none of them reads fantastically well: 1. [create, update].should include(controller.action_name) Problem: The error message, should it fail, is: expected

Re: [rspec-users] Specifying a few valid values

2008-07-17 Thread David Chelimsky
On Thu, Jul 17, 2008 at 6:18 AM, Jonathan Leighton [EMAIL PROTECTED] wrote: I have a Rails spec where I want to check that the action_name is either create or update. I can think of a couple of ways to do it, but none of them reads fantastically well: 1. [create, update].should

Re: [rspec-users] Specifying a few valid values

2008-07-17 Thread Jonathan Leighton
On Thu, 2008-07-17 at 07:28 -0500, David Chelimsky wrote: I'm wondering why the examples aren't more specific though. Why is it OK that the action could be one of two possibilities given a specific set of givens? Ok well I lied a little bit :) I am using it in a story step, specifically the

Re: [rspec-users] Specifying a few valid values

2008-07-17 Thread David Chelimsky
On Jul 17, 2008, at 7:40 AM, Jonathan Leighton wrote: On Thu, 2008-07-17 at 07:28 -0500, David Chelimsky wrote: I'm wondering why the examples aren't more specific though. Why is it OK that the action could be one of two possibilities given a specific set of givens? Ok well I lied a little

Re: [rspec-users] Specifying a few valid values

2008-07-17 Thread Jonathan Leighton
On Thu, 2008-07-17 at 08:50 -0500, David Chelimsky wrote: Are you familiar with Webrat? Yep, we are using it. However, I want to test what happens when invalid data is entered - that's the reason to specify that the form gets shown. What would you consider a better approach to verify the user

Re: [rspec-users] Specifying a few valid values

2008-07-17 Thread Zach Dennis
Perhaps... When I login with invalid credentials Then I see that I have not been logged in And in your implementation of the Then you could make sure they are at the login form still. Zach On Thu, Jul 17, 2008 at 10:19 AM, Jonathan Leighton [EMAIL PROTECTED] wrote: On Thu, 2008-07-17

Re: [rspec-users] Specifying a few valid values

2008-07-17 Thread Jonathan Leighton
On Thu, 2008-07-17 at 09:40 -0500, David Chelimsky wrote: On Thu, Jul 17, 2008 at 9:37 AM, Zach Dennis [EMAIL PROTECTED] wrote: Perhaps... When I login with invalid credentials Then I see that I have not been logged in Or When I login with invalid credentials Then I should