ActiveRecord doesn't know anything about db constraint errors. If
one
is violated, the error propagates up in the form of an exception.
I realize that, but the exception is of the
ActiveRecord:StatementInvalid class, which I should be able to catch
in
the controller with a rescue clause.
Just a stab in the dark, but I haven't seen any mention of calling
save vs. save!. save just puts any errors in the model, save! will
raise the exception if there are any errors. That may not be the case
for ActiveRecord:StatementInvalid exception, but I thought i'd
mention
it anyway.
I
according to this post:
http://blog.davidchelimsky.net/2009/1/13/rspec-1-1-12-is-released
I should be able to write:
describe User do
it {should valdate_presence_of(:login)}
end
with rspec 1.1.12
But I got:
NO NAME
undefined method `valdate_presence_of' for
This is giving me an error:
When /?:(log|sign)?:(i|o)n success message/ do
Then welcome message
end
I could be wrong, but I believe you're looking for this instead?
When /(?:log|sign)(?:i|o)n success message/ do
hope that helps,
timg
___
I think it would be a great app to have, which would work well
inside a web browser, rather than a fat client that customers and
managers have to download...?
+1, I think keeping it in the browser will work well for most
situations. One option is to make it a flex app and could then be
hey all,
I've started playing around with object daddy and have a question? How
do I ensure that anything created during a spec example gets rolled
back before the next one?
Without that ability, it starts messing with models that have unique
columns on successive runs of my specs.
Oh,
Oh, and I do have this line in my spec_helper:
config.use_transactional_fixtures = true
I assume that only does anything to fixtures, specifically
No. That tells rspec/ test::unit to start a transaction at the
start of every test case, and issue a rollback when it's over.
That + a
I'm running Rails 2.1.1 and the newest cucumber gem/plugin as of this
morning.
When I run scripts like `ruby script/generate`
or any (I think) rake task (I tried 4 or 5), I get the following
timg-2:1-3-development tim$ rake db:version
(in /Users/tim/projects/dt/branches/1-3-development)
Why don't use just use a slug for these things? In other words - use
a unique name for each record, since the numbers 10 and 11 don't
mean much to anyone.
Then, use a factory (like FixtureReplacement or Object Daddy) to
generate the records in env.rb. Here's how you'd do that with
I've got some code that I (mostly) inherited. It essentially has a
couple of AR class methods that look for a specific record by id:
class Project ActiveRecord::Base
class self
def specific_project
@another_specific_project ||= Project.find(10) if
Project.exists?(10)
end
into my Steps Before block, but that doesn't work
either.
any thoughts?
--
Tim Glen
Rails 2.0.2
RSpec 1.1.4
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users
/1.8/gems/actionpack-2.0.2/lib/
action_controller/integration.rb:448:in `method_missing'
./features/steps/cart_steps.rb:8:in `Given /I am on the new
project investment page/'
features/cart.feature:36:in `Given that I am on the new project
investment page'
--
Tim Glen
[EMAIL PROTECTED
Before do
self.extend(FixtureReplacement)
end
I had previously tried this right in the steps file:
Before do
self.include(FixtureReplacement)
end
Actually - this turned out to almost the right thing. I just added
this to my env.rb:
`include FixtureReplacement`
Wrapping it in the Before
Did you see that my code uses extend?
Yes - tried both in my flailing about :)
If that still doesn't work, file a bug report.
http://rspec.lighthouseapp.com/projects/16211-cucumber/overview
It might be a FixtureReplacement bug, but I'll still look into it.
Could it be that
So I find myself wondering - is this the case for just helper
modules or all modules? For instance, I have a module which gets
included into some controllers, but I'd like to spec against it
directly so I don't have in those other controllers... I'm not sure
how to set this up. What's the
need to be registered
in rails for this to work (if you have need of one outside of the
norm), which arguably has the added benefit of ensuring you added it
into your environment initializers...
--
Tim Glen
On 25-Mar-08, at 12:46 PM, Matt Berther wrote:
Hi Seth,
To get around this, are you
since i'm on rspec trunk, I applied your patch and ran into a little
issue. All my specs still run but it seems to be looking at and
attempting all of my hidden files and directories (and some other
stuff too?):
snippet
Dunno! Capfile
Dunno! app/helpers/.svn/format
Dunno!
AM, David Chelimsky [EMAIL PROTECTED] wrote:
On Jan 11, 2008 9:45 AM, Tim Glen [EMAIL PROTECTED] wrote:
since i'm on rspec trunk, I applied your patch and ran into a little
issue. All my specs still run but it seems to be looking at and
attempting all of my hidden files and directories (and some
18 matches
Mail list logo