aboutsummaryrefslogtreecommitdiffstats
path: root/guides
diff options
context:
space:
mode:
authorZachary Scott <e@zzak.io>2014-12-20 15:30:55 -0800
committerZachary Scott <e@zzak.io>2014-12-20 15:30:55 -0800
commit4ad9d685815f27fe54aed2019755abf2ec8c2cf4 (patch)
tree59ccd02a45e69f519e2b15676bdb322bb7f24665 /guides
parent72752643bb14ab2f9bffbfe94b61533e93132308 (diff)
downloadrails-4ad9d685815f27fe54aed2019755abf2ec8c2cf4.tar.gz
rails-4ad9d685815f27fe54aed2019755abf2ec8c2cf4.tar.bz2
rails-4ad9d685815f27fe54aed2019755abf2ec8c2cf4.zip
Fixture data is accessible by a local method, and not a variable [ci skip]
Diffstat (limited to 'guides')
-rw-r--r--guides/source/testing.md4
1 files changed, 2 insertions, 2 deletions
diff --git a/guides/source/testing.md b/guides/source/testing.md
index 76eca45636..c8a87c57e8 100644
--- a/guides/source/testing.md
+++ b/guides/source/testing.md
@@ -120,13 +120,13 @@ Rails by default automatically loads all fixtures from the `test/fixtures` direc
* Remove any existing data from the table corresponding to the fixture
* Load the fixture data into the table
-* Dump the fixture data into a variable in case you want to access it directly
+* Dump the fixture data into a method in case you want to access it directly
TIP: In order to remove existing data from the database, Rails tries to disable referential integrity triggers (like foreign keys and check constraints). If you are getting annoying permission errors on running tests, make sure the database user has privilege to disable these triggers in testing environment. (In PostgreSQL, only superusers can disable all triggers. Read more about PostgreSQL permissions [here](http://blog.endpoint.com/2012/10/postgres-system-triggers-error.html))
#### Fixtures are Active Record objects
-Fixtures are instances of Active Record. As mentioned in point #3 above, you can access the object directly because it is automatically setup as a local variable of the test case. For example:
+Fixtures are instances of Active Record. As mentioned in point #3 above, you can access the object directly because it is automatically available as a method who's scope is local of the test case. For example:
```ruby
# this will return the User object for the fixture named david