[rspec-users] [rails] shoud I test validate_presentence_of series?

2010-07-21 Thread Zhenning Guan
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

Re: [rspec-users] [rails] shoud I test validate_presentence_of series?

2010-07-21 Thread Craig Demyanovich
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

Re: [rspec-users] [rails] shoud I test validate_presentence_of series?

2010-07-21 Thread Phillip Koebbe
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

[rspec-users] 'its' not working

2010-07-21 Thread Andrew Premdas
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

Re: [rspec-users] 'its' not working

2010-07-21 Thread David Chelimsky
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 =

Re: [rspec-users] Data-wise context combination for controller speccing

2010-07-21 Thread Costa Shapiro
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

Re: [rspec-users] How it would be tested?

2010-07-21 Thread Costa Shapiro
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

Re: [rspec-users] spec w/o db:test:prepare

2010-07-21 Thread Peter Fitzgibbons
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

[rspec-users] rspec-orm and _not_ mocking models

2010-07-21 Thread Costa Shapiro
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

Re: [rspec-users] spec w/o db:test:prepare

2010-07-21 Thread David Chelimsky
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

Re: [rspec-users] spec w/o db:test:prepare

2010-07-21 Thread David Chelimsky
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

Re: [rspec-users] [rails] shoud I test validate_presentence_of series?

2010-07-21 Thread Zhenning Guan
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

Re: [rspec-users] How it would be tested?

2010-07-21 Thread tests learner
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