Suppose I have a model Forum, have some attributes, title, content,
tag.so I do it in Forum model.
validates_presence_of :title
validates_presence_of :tag
validates_presence_of :content.
when I added validateds_presence_of, rails will restrict the attribute
not be empty, when save record. so
I like covering validation with RSpec instead of only relying on it being
covered at a higher level. I like to check for error(s) on each attribute to
be sure that the model is not invalid for some other reason. Here's how I do
it:
describe Forum, 'being valid' do
it requires a name do
On 2010-07-21 1:41 AM, Zhenning Guan wrote:
Suppose I have a model Forum, have some attributes, title, content,
tag.so I do it in Forum model.
validates_presence_of :title
validates_presence_of :tag
validates_presence_of :content.
when I added validateds_presence_of, rails will restrict the
trying out new syntax from jon larkowski's rspec presentation. Following
doesn't work in that when I run the line from the command prompt or from
textmate no specs are run
context cancel do
subject do
order = at_dropshipping
order.cancel_dropship!
order
end
On Jul 21, 2010, at 10:09 AM, Andrew Premdas wrote:
trying out new syntax from jon larkowski's rspec presentation. Following
doesn't work in that when I run the line from the command prompt or from
textmate no specs are run
context cancel do
subject do
order =
Thank you very much for your valuable feedback.
First, the example is a toy example of course, while the idea of
mixing-matching contexts is not. Note that it would be a totally
backward-compatible enhancement to rspec, and that a developer would still
be in full control of what gets
Dear Mr. Learner,
Please note that while very similar in functionality, specs' philosophy
differs from tests' (especially from non-TDD ones).
That is, you write spec first, see it fail, and write some code to make it
pass.
If you happen to write any implementation code first, you should disregard
How 'bout for rspec2?
BTW: Where should these magic lines be placed? Inside a
./config/initializers/my_init.rb ??
Peter Fitzgibbons
(847) 859-9550
Email: peter.fitzgibb...@gmail.com
IM GTalk: peter.fitzgibbons
IM AOL: peter.fitzgibb...@gmail.com
On Tue, Jul 20, 2010 at 6:40 PM, David
Hello,
(Surprisingly?) I find mocking AR (DM less so) in specs extremely tedious
_and_ intrusive.
Having said this, I find the approach of top-down VCM speccing very
legitimate (cucumber for V, rspec for C, and probably unit tests for M).
That is, a model is an inherent though separate part of
On Jul 21, 2010, at 4:17 PM, David Chelimsky wrote:
On Jul 21, 2010, at 3:32 PM, Peter Fitzgibbons wrote:
On Tue, Jul 20, 2010 at 6:40 PM, David Chelimsky dchelim...@gmail.com
wrote:
On Jul 20, 2010, at 4:18 PM, Peter Fitzgibbons wrote:
HI All,
I would like to perform my spec runs
On Jul 21, 2010, at 3:32 PM, Peter Fitzgibbons wrote:
On Tue, Jul 20, 2010 at 6:40 PM, David Chelimsky dchelim...@gmail.com wrote:
On Jul 20, 2010, at 4:18 PM, Peter Fitzgibbons wrote:
HI All,
I would like to perform my spec runs without the db:test:prepare rake
prereq.
It would be
thank you all. :)
--
Posted via http://www.ruby-forum.com/.
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users
Costa Shapiro,
Thank you for paying atention.
But How i would write if i don't know nothing about the code ?
My problem is:
I have a messages listing section that will differ according of type
of user and according with message permission.
I have messages that are public and private.
Anyone can
13 matches
Mail list logo