[rspec-users] Not able to run tests on rails

Nadal node.js99 at gmail.com
Sat May 22 21:17:58 EDT 2010


Got it. File name should be user_spec.rb and not user_test.rb .

On May 22, 8:42 pm, Nadal <node.j... at gmail.com> wrote:
> This is what I did. Please tell me where did I go wrong.
>
> # I am using rails 2.3.5
> rails demo
> cd demo
> ruby script/generate scaffold User name:string
> rake db:migrate
> rake db:test:prepare
>
> ruby script/plugin install git://github.com/dchelimsky/rspec.git -r
> 'refs/tags/1.2.9'
> ruby script/plugin install git://github.com/dchelimsky/rspec-rails.git
> -r 'refs/tags/1.2.9'
>
> mkdir spec/models
>
> touch spec/models/user_test.rb
>
> # this is the contents of user_test.rb
> require File.dirname(__FILE__) + '/../spec_helper'
> describe User do
>   before(:each) do
>     @user = User.new
>   end
>   describe "attributes" do
>     it "should be valid" do
>       @user.should be_valid
>     end
>   end
> end
>
> # then I ran test and nothing happen. The output is blank.
> rake spec:models
>
> _______________________________________________
> rspec-users mailing list
> rspec-us... at rubyforge.orghttp://rubyforge.org/mailman/listinfo/rspec-users
>
> --
> You received this message because you are subscribed to the Google Groups "rspec" group.
> To post to this group, send email to rspec at googlegroups.com.
> To unsubscribe from this group, send email to rspec+unsubscribe at googlegroups.com.
> For more options, visit this group athttp://groups.google.com/group/rspec?hl=en.


More information about the rspec-users mailing list