On Jan 24, 2008 1:04 AM, Ben Mabey <[EMAIL PROTECTED]> wrote:
> While the original post had DRY in the subject line I don't see this as
> a DRY issue. I see it as a visualization and maintenance issue. If I
> add a new role and I want to test each action for it's permissions it
> would be much ea
On Jan 23, 2008 9:30 PM, Kamal Fariz <[EMAIL PROTECTED]> wrote:
> Slightly OT, but what can be done to DRY up steps? For aesthetics and
> more natural sounding stories, I often have things like
>
> Given a user in the system
>
> and
>
> Given 2 users in the system
>
> where the small change is in t
Slightly OT, but what can be done to DRY up steps? For aesthetics and
more natural sounding stories, I often have things like
Given a user in the system
and
Given 2 users in the system
where the small change is in the pluralization. What I currently do is
to have two steps that essentially
While the original post had DRY in the subject line I don't see this as
a DRY issue. I see it as a visualization and maintenance issue. If I
add a new role and I want to test each action for it's permissions it
would be much easier for a customer to go down a spread sheet and
designate within
On Jan 23, 2008 10:45 PM, Neil M. Young <[EMAIL PROTECTED]> wrote:
>
> I'm finding that I'm writing sets of very similar scenarios to check access
> permissions for each of my actions. Does anyone have suggestions on how to
> dry this up:
>
Beware that DRY has a cost. Clarity and readability.
Dav
Do all of these scenarios exist in the same story?
Should they be dried up?
Would Clarity over Cleverness apply here?
On Jan 23, 2008 4:45 PM, Neil M. Young <[EMAIL PROTECTED]> wrote:
>
> I'm finding that I'm writing sets of very similar scenarios to check
> access
> permissions for each of my ac
Ah, I completely missed the :user= => in your snippet. Sorry about that. It
worked, though, just the way you described it. :)
Here's my spec now, wonderful:
http://pastie.caboo.se/142585
Thanks, David and Jarkko!
-Corey
On Jan 23, 2008 1:05 PM, Jarkko Laine <[EMAIL PROTECTED]> wrote:
>
> On 23
Neil M. Young wrote:
> I'm finding that I'm writing sets of very similar scenarios to check access
> permissions for each of my actions. Does anyone have suggestions on how to
> dry this up:
>
> Given an existing Account
> And a logged in Admin
> When the user visits account/manage
> Then he should
I'm finding that I'm writing sets of very similar scenarios to check access
permissions for each of my actions. Does anyone have suggestions on how to
dry this up:
Given an existing Account
And a logged in Admin
When the user visits account/manage
Then he should get access
Given an existing Acco
On 23.1.2008, at 18.57, Corey Haines wrote:
> Nope, that still didn't work.
> Still getting
> @coupon.stub!(:user=).with(@current_user)
>
> Here's my spec and code using your recommended way:
>
> spec - http://pastie.caboo.se/142451
> code - http://pastie.caboo.se/142452
>
> If I add back
>
Ooops, I mean still getting
Mock 'Coupon_1011' received unexpected message :user= with (#)
On Jan 23, 2008 11:57 AM, Corey Haines <[EMAIL PROTECTED]> wrote:
> Nope, that still didn't work.
> Still getting
> @coupon.stub!(:user=).with(@current_user)
>
> Here's my spec and code using your rec
Nope, that still didn't work.
Still getting
@coupon.stub!(:user=).with(@current_user)
Here's my spec and code using your recommended way:
spec - http://pastie.caboo.se/142451
code - http://pastie.caboo.se/142452
If I add back
@coupon.stub!(:user=).with(@current_user)
they pass.
It seem
On 23.1.2008, at 18.02, Corey Haines wrote:
> I get the unexpected message :user= failure.
>
> When you set up the mock with the initial parameters, wouldn't those
> be stubbing: @coupon.stub!(:user).and_return(@current_user)
>
You can do it like this:
@coupon = mock_model(Coupon, :user= => ni
That's what I found. :) I'll reference that with my blog post. (I'll write
it mostly for the experience, as it will basically outline just what your
post says)
On Jan 23, 2008 10:36 AM, David Chelimsky <[EMAIL PROTECTED]> wrote:
>
> FYI -
> http://blog.davidchelimsky.net/articles/2006/11/09/tutor
I get the unexpected message :user= failure.
When you set up the mock with the initial parameters, wouldn't those be
stubbing: @coupon.stub!(:user).and_return(@current_user)
While, my spec says that I want :user= to be called?
-corey
On Jan 23, 2008 10:35 AM, David Chelimsky <[EMAIL PROTECTED]>
Strange. I'll try it again, but it failed, which was why I added the stub.
Let me see if I mis-typed something.
On Jan 23, 2008 10:35 AM, David Chelimsky <[EMAIL PROTECTED]> wrote:
> On Jan 23, 2008 9:24 AM, Corey Haines <[EMAIL PROTECTED]> wrote:
> > Thanks, David!
> >
> > Here's what I morphed
On Jan 23, 2008 9:24 AM, Corey Haines <[EMAIL PROTECTED]> wrote:
> Thanks, David!
>
> Here's what I morphed the specs into:
>
> http://pastie.caboo.se/142411
>
> And, I ended up with a blog entry that I'll write tonight.
>
> Basically, here's the situation I've been running into which is causing m
On Jan 23, 2008 9:35 AM, David Chelimsky <[EMAIL PROTECTED]> wrote:
> On Jan 23, 2008 9:24 AM, Corey Haines <[EMAIL PROTECTED]> wrote:
> > Thanks, David!
> >
> > Here's what I morphed the specs into:
> >
> > http://pastie.caboo.se/142411
> >
> > And, I ended up with a blog entry that I'll write ton
Thanks, David!
Here's what I morphed the specs into:
http://pastie.caboo.se/142411
And, I ended up with a blog entry that I'll write tonight.
Basically, here's the situation I've been running into which is causing my
specs to grow.
If I don't set up something to tell the coupon that it is goin
On Jan 23, 2008 8:49 AM, Corey Haines <[EMAIL PROTECTED]> wrote:
> Of course. Thanks, David! I still am getting used to user=, rather than just
> user. Thanks again.
No problem. I certainly got caught by that early on.
I have some more general comments. See below:
>
> -Corey
>
>
>
> On Jan 23, 2
Of course. Thanks, David! I still am getting used to user=, rather than just
user. Thanks again.
-Corey
On Jan 23, 2008 9:46 AM, David Chelimsky <[EMAIL PROTECTED]> wrote:
> On Jan 23, 2008 8:41 AM, Corey Haines <[EMAIL PROTECTED]> wrote:
> > All,
> >
> > I'm missing something simple, I think. I
On Jan 23, 2008 8:41 AM, Corey Haines <[EMAIL PROTECTED]> wrote:
> All,
>
> I'm missing something simple, I think. I am writing a spec to say that my
> CouponController should create a new coupon from the form parameters, then
> set the current user. Here's the spec:
>
> describe CouponController,
All,
I'm missing something simple, I think. I am writing a spec to say that my
CouponController should create a new coupon from the form parameters, then
set the current user. Here's the spec:
describe CouponController, "When posting to save_coupon" do
before(:each) do
@expectedName = "pep
Oh, and one follow-up, the app works how I expect it to work if I run
through the browser.
On Jan 23, 2008 9:41 AM, Corey Haines <[EMAIL PROTECTED]> wrote:
> All,
>
> I'm missing something simple, I think. I am writing a spec to say that my
> CouponController should create a new coupon from the f
On Jan 22, 2008 2:58 PM, BenFyvie <[EMAIL PROTECTED]> wrote:
>
> Thanks for your quick response Luis!
>
> I've actually gone to the extent of creating a brand spankin new rails
> project, installed the plugins, ran the bootstrap, created a simple table
> with a simple test and I get the same proble
David just posted about the new --patterns option in the trunk. His examples
don't include changing the directory structure, but I would think that it
would allow that. If not, that would be a good patch.
http://blog.davidchelimsky.net/articles/2008/01/20/rspec-new-pattern-option
-Corey
On Jan 2
Hi,
I'm trying to spec a controller method which renders some rjs as part
of a render :update block. The problem I'm having is that stub_render
or expect_render don't seem to allow and_return to work.
The controller method does:
if @thing.save
render :update do
You are God.
Thanks! You can't imagine the amount of time we wasted on that one ;-)
> If that works, then you've uncovered a bug with integrate_views not
> working in nested example groups.
that was exactly the problem.
> If so, please report it to the tracker
definitely
--
Posted via ht
I'd like to change the rspec directory structure from
/spec
/model
/controllers
etc
to
/spec
/unit
/models
/controllers
/lib
/functional
/models
/controllers
etc.
Basically the Jay Fields style of testing -- I want the unit tests to
be run all the time on
29 matches
Mail list logo