aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source
diff options
context:
space:
mode:
authorRichard Schneeman <richard.schneeman@gmail.com>2014-12-10 00:44:35 +0800
committerRichard Schneeman <richard.schneeman@gmail.com>2014-12-10 00:44:35 +0800
commit44a6ed2fe5330d78db6eee0f3eb0ced8e7f4f421 (patch)
treee32da8a675cd576a1e9577d508c43835e76ebb3a /guides/source
parent5c7b5dc741f6980de2592e9b113ae385000a6da7 (diff)
parent6d59473b4873a81d7cc56023d17f8ec83075b803 (diff)
downloadrails-44a6ed2fe5330d78db6eee0f3eb0ced8e7f4f421.tar.gz
rails-44a6ed2fe5330d78db6eee0f3eb0ced8e7f4f421.tar.bz2
rails-44a6ed2fe5330d78db6eee0f3eb0ced8e7f4f421.zip
Merge pull request #17982 from andreynering/testing-documentation
Testing Guides: adding TIP about database permission problems [ci skip]
Diffstat (limited to 'guides/source')
-rw-r--r--guides/source/testing.md2
1 files changed, 2 insertions, 0 deletions
diff --git a/guides/source/testing.md b/guides/source/testing.md
index d54f431d54..40abac0507 100644
--- a/guides/source/testing.md
+++ b/guides/source/testing.md
@@ -122,6 +122,8 @@ Rails by default automatically loads all fixtures from the `test/fixtures` folde
* Load the fixture data into the table
* Dump the fixture data into a variable 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, just 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: