[rspec-users] Rspec approach to test model

2009-02-11 Thread Kaleem Ullah
Hi, I am quite new to Rspec. I want to use Rspec to test my existing Code. I start from Models (Unit Testing). Here i want your help on a issue. Here is model/user_spec.rb describe User do before(:each) do @user=User.new @user.id='2' @user.email='k...@gmail.com' @user.password

Re: [rspec-users] Rspec approach to test model

2009-02-11 Thread Kaleem Ullah
James Byrne wrote: > I recently installed nakajima-acts_as_fu (0.0.3) gem. This provides a > rather painless way of specifying ActiveRecord model schemata on the fly > in your specifications. You might find it helpful to look into this. > > You will discover that some people favour mocks and

Re: [rspec-users] Rspec approach to test model

2009-02-11 Thread Kaleem Ullah
Nick Hoffman wrote: > To spec your #activate! , why not do something like this?: > > it 'should activate the user' do >@user.active.should be_false >@user.activate! >@user.active.should be_true > end > > Thanks for your reply Hoffman :) I did the same but it gives error like "#230

Re: [rspec-users] Rspec approach to test model

2009-02-11 Thread Kaleem Ullah
Scott Taylor wrote: > On Feb 11, 2009, at 8:51 AM, Kaleem Ullah wrote: > >>@user=User.new >>@user.active= '1' >>@user.reset_password_token= '' >> end > > You could benefit from a factory / data builder. See > FixtureRep

Re: [rspec-users] Rspec approach to test model

2009-02-11 Thread Kaleem Ullah
Hi all, Below is my model action. def activate! self.update_attribute(:active, true) end here is spec/models/user_spec.rb describe User do before(:each) do @user=User.new(:email=>'k...@gmail.com',:password='1234',) end This is my spec. it "should activate the user" do @user.a

[rspec-users] Culerity Error while running feature.

2009-02-22 Thread Kaleem Ullah
/bin/cucumber:19:in `load' from c:/ruby/bin/cucumber:19 Thanks for your Help. Regards, Kaleem Ullah -- 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] Culerity Error while running feature.

2009-02-22 Thread Kaleem Ullah
Let me try... Thanks for your reply. -- Posted via http://www.ruby-forum.com/. ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users