|
Sam Wilson |
Posts by Sam Wilson
|
13 Oct 2010, 22:24
Sam Wilson (5 posts) |
I am working through the depot application using the “b9” iteration of the book. So far, everything is fine up to the point where I try to run my tests. I am getting the following errors (abbreviated) when I run the “rake test” command as per page 98: 1) Error: test_should_create_product(ProductsControllerTest): FixturesFileNotFound: Could not find /Users/Sam/Sites/depot/test/fixtures/roducts.yml or /Users/Sam/Sites/depot/test/fixtures/roducts.csv So, to me it looks like there is some kind of problem with the code that generates the name of the fixture file. As you can see it is missing the first letter of the filename. Any suggestions? I’m on OS X Snow Leopard, version info: samimac:~ Sam$ ruby --version rubinius 1.1.0 (1.8.7 42228cee 2010-09-23 JI) [x86_64-apple-darwin10.4.0] samimac:~ Sam$ rails --version Rails 3.0.0 Let me know if I can provide any further information to help diagnose the problem. Thanks! Sam ps. Love the book! |
|
13 Oct 2010, 22:48
Sam Wilson (5 posts) |
And just to clarify, the file “test/fixtures/products.yml” does exist. |
|
13 Oct 2010, 22:56
Sam Wilson (5 posts) |
And to make things even more weird, check this out: if I copy the products.yml fixtures file to “roducts.yml” I then get this error: 1) Error: test_should_create_product(ProductsControllerTest): FixturesFileNotFound: Could not find /Users/Sam/Sites/depot/test/fixtures/oducts.yml or /Users/Sam/Sites/depot/test/fixtures/oducts.csv Yeah, so if I keep copying files with shorter and short names, it keeps reporting an error with a shorter and shorter expected file name. I made copies of the file removing each leading letter until I was left with a file named “l”. Then, when I run “rake test” I get no output at all: samimac:depot Sam$ rake test (in /Users/Sam/Sites/depot) samimac:depot Sam$ Bizarre… |
|
19 Oct 2010, 23:33
Sam Wilson (5 posts) |
Rails looks at the database schema to determine the basic attributes of the model classes. During its initialization process it looks at the database schema and augments the class definition with the appropriate attributes. You’ll find that you can add additional attributes that are “volatile” (see the part about user authentication for some insight). So, you won’t generally see definitions of each attribute of a model class like you will in other frameworks. Instead, you’ll see various settings applied to those attributes (such as the validations and entity relationships) when they are needed. By default, however, the model class definitions are empty because they are inferred from the schema. |
|
19 Oct 2010, 23:43
Sam Wilson (5 posts) |
I gotta say, this whole experience has left me really questioning the quality of Rails 3 and whether it isn’t just a tad bit buggy. Anybody have any feelings about the readiness of Rails 3 for prime-time? |
5 posts
