Hi Juanma,
I do this this way:
describe Model do
def create(options={})
Model.create(options)
end
it "should not allow duplicate names" do
model = create(:name => "name")
new_model = create(:name => "name")
new_model.should have_error_on(:name, :taken)
end
end
-
On 03/04/2008, at 10:09 , Tim Haines wrote:
> For now I can add response.code.should == "200" or something similar..
The page returned by Rails to provide you with the stack trace and
stuff? That is a valid HTML page, and it comes along with a HTTP 200
OK response.
What you need to do is loo
Ahhh, clever. I see the light
On Wed, Apr 2, 2008 at 8:19 AM, Corey Haines <[EMAIL PROTECTED]> wrote:
> Create an instance of the controller
>
> contr = MyController.new
>
> MyController.stub!(:new).and_return contr
>
> contr.stub!(:method_i_want_to_stub).and_return 'sweetness'
>
> Something like
I got this way wrong. It was due to pages not rendering due to there being
an error in the view (that I wasn't aware of). The problem in the view was
due to the test database not being up to date with the latest migrations...
(so page was rendering correctly in dev mode) I'm happy I've persisted
On Wed, Apr 2, 2008 at 6:09 PM, Tim Haines <[EMAIL PROTECTED]> wrote:
> Hi'ya
>
> I have a When step that calls get game_url. It turns out that calling this
> page is resulting in a render error, which explains my failing Then steps.
> It would help me if the story told me there was a problem rend
Hi'ya
I have a When step that calls get game_url. It turns out that calling this
page is resulting in a render error, which explains my failing Then steps.
It would help me if the story told me there was a problem rendering the
response. Is there any way to get the story steps to automatically r
Hi Tim
I haven't had a chance to look at stories yet ... but can u not use
the AuthenticatedTestHelper login_as method?
Cheers
Shane
On 2/04/2008, at 6:16 PM, Tim Haines wrote:
> Hi there,
>
> Given my recent problems with .should render_template after a second
> post, I'm wondering if the
Create an instance of the controller
contr = MyController.new
MyController.stub!(:new).and_return contr
contr.stub!(:method_i_want_to_stub).and_return 'sweetness'
Something like this?
-Corey
On Wed, Apr 2, 2008 at 12:22 AM, Jed Hurt <[EMAIL PROTECTED]> wrote:
> I'm not sure how that would wo
Just thought I'd send out a little update on using this library. Great! We
converted our tests over to using it, and I'm very happy with it. Good job,
Kyle! Keep up the good work.
It did take a bit of time to convert (using @ in attributes, for example),
but it was well worth it.
-Corey
On Wed, M
On Wed, Apr 2, 2008 at 1:19 AM, Courtenay <[EMAIL PROTECTED]> wrote:
> IMO this function should be tested using the database, since it relies
> heavily on the data.
Agreed. Create a record, then create another record with duplicate
data, and verify that the second record is invalid.
Pat
___
IMO this function should be tested using the database, since it relies
heavily on the data.
Courtenay
@(o..O)@
On Apr 2, 2008, at 1:13 AM, Juanma Cervera <[EMAIL PROTECTED]> wrote:
> Hello
>
> I am learning rspec and trying to especify the activerecord
> validations
> of my
Hello
I am learning rspec and trying to especify the activerecord validations
of my models.
How would I make a require_uniqueness_of specification for a field.
Can I make this with mocks, without touching the database?
Can somebody point me to some information or plugin for this issue.
Thank you
12 matches
Mail list logo