Permalink
Browse files

[#1035] Removing references to Fixtures.load() in docs and selenium tag

  • Loading branch information...
1 parent 4e37e65 commit 9cb6c3b498ac11bc6192b8f1b1a85fc9ece22981 @yall yall committed Aug 13, 2011
@@ -1,9 +1,9 @@
h2. Test - Data loader
*==@Before public void setUp() { Fixtures.deleteAll();==*
-*==Fixtures.load("data.yml");}==*
+*==Fixtures.loadModels("data.yml");}==*
Fixtures is used to initialise the datastore before running a unit test
-*==#{fixture delete:'all', load:'data.yml' /}==*
+*==#{fixture delete:'all', loadModels:'data.yml' /}==*
*==#{selenium} ... #{/selenium}==*
Same idea using a Selenium test
@@ -1,4 +1,4 @@
-h1. Completing the application tests
+loadModels:h1. Completing the application tests
We’ve now finished the blog engine we wanted to create in this tutorial. However the project itself is not yet completely finished. To be totally confident with our code we need to add more tests to the project.
@@ -76,7 +76,7 @@ This test should run without any problem with the yabe application. It just open
However like any complex test, you need to set-up a set of well-known data before navigating the application and testing it. We will of course reuse the fixture concept and the @yabe/test/data.yml@ file that we’ve used before. To import this data set before the test suite, just use the @#{fixture /}@ tag:
-bc. #{fixture delete:'all', load:'data.yml' /}
+bc. #{fixture delete:'all', loadModels:'data.yml' /}
#{selenium}
// Open the home page, and check that no error occurred
@@ -89,7 +89,7 @@ Another important thing to check is that we have a fresh user session at the tes
So let’s start our test with a special command:
-bc. #{fixture delete:'all', load:'data.yml' /}
+bc. #{fixture delete:'all', loadModels:'data.yml' /}
#{selenium}
clearSession()
@@ -104,7 +104,7 @@ Run it to be sure that there is no mistake. It should be green.
So we can write a more specific test. Open the home page and check that the default posts are present:
-bc. #{fixture delete:'all', load:'data.yml' /}
+bc. #{fixture delete:'all', loadModels:'data.yml' /}
#{selenium 'Check home page'}
clearSession()
@@ -1,4 +1,4 @@
-h1. Test your application
+loadModels:h1. Test your application
Creating automatic test suites for your application is a good way to make it robust. It allows you to work in a very agile way.
@@ -166,7 +166,7 @@ p(note). You can read more about Play and YAML in the "YAML manual page":yaml.
For Selenium tests, you can use the @#{fixture /}@ tag:
-bc. #{fixture delete:'all', load:'data.yml' /}
+bc. #{fixture delete:'all', loadModels:'data.yml' /}
#{selenium}
@@ -180,7 +180,7 @@ bc. Fixtures.loadModels("users.yml", "roles.yml", "permissions.yml");
and for Selenium tests:
-bc. #{fixture delete:'all', load:['users.yml', 'roles.yml', 'permissions.yml'] /}
+bc. #{fixture delete:'all', loadModels:['users.yml', 'roles.yml', 'permissions.yml'] /}
h2. <a name="running">Running the tests</a>
@@ -7,8 +7,10 @@
}%
%{
- if(_load) {
- play.test.Fixtures.load(_load)
+ if(_loadModels) {
+ play.test.Fixtures.loadModels(_loadModels)
+ } else if(_load) {
+ play.test.Fixtures.loadModels(_load)
}
}%
@@ -1,5 +1,5 @@
# you describe your data using the YAML notation here
-# and then load them using Fixtures.load("data.yml")
+# and then load them using Fixtures.loadModels("data.yml")
# User(bob):
# email: bob@gmail.com

0 comments on commit 9cb6c3b

Please sign in to comment.