On Thu, Jun 11, 2009 at 11:50 AM, Amit Kulkarni<[email protected]> wrote:
> Hi,
>
>   I am running controller spec and it gives me result as 0 examples, 0
> failures.
>
>   I checked into the database and i saw that fixtures are not loaded.
>
>   Following are the details of my controller file.
>
>
>   require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
> def valid_bb_post_attributes
>  {
>    :body => "test description",
>    :title => "test"
>  }
> end
> describe BbPostsController do
>  context "test" do
>    fixtures :bb_posts, :users
>   �...@user = User.find_by_login("amit")
>    if @user
>      it "should create post" do
>        post = create_post
>        post.should be_valid
>      end
>    end
>  end
>
> My bb_posts.ml file contains
>
> bb_post1:
>  id: 1
>  body: body_description
>  title: test
>
> bb_post2:
>  id: 2
>  body: aasasaskajs
>  title: wwwww
>
> Similarly my users.yml contains
>
> amit:
>  id: 6
>  login: amit
>  email: [email protected]
>
> kiran:
>  id : 7
>  login: kiran
>  email: [email protected]
>
>
> I dont know what is wrong.
> Please suggest :-)

Make sure that the fixtures are in the same place that is declared in
spec/spec_helper.rb.
_______________________________________________
rspec-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to