Skip to content

Commit 722b55c

Browse files
committed
Update README [ci skip]
1 parent 4ea8460 commit 722b55c

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,8 @@ Don't forget to make sure the proper route has been added to `config/routes.rb`.
337337

338338
[See here](#pass-options-to-the-datatable-class) if you need to inject params in the `UserDatatable`.
339339

340+
**Note :** If you have more than **2** datatables in your application, don't forget to read [this](#use-http-post-method-medium).
341+
340342
### 5) Wire up the Javascript
341343

342344
Finally, the javascript to tie this all together. In the appropriate `coffee` file:
@@ -682,6 +684,18 @@ In the end, it's up to the developer which model(s), scope(s), relationship(s)
682684
(or else) to employ inside the datatable class to retrieve records from the
683685
database.
684686

687+
## Tests
688+
689+
Datatables can be tested with Capybara provided you don't use Webrick during integration tests.
690+
691+
Long story short and as a rule of thumb : use the same webserver everywhere (dev, prod, staging, test, etc...).
692+
693+
If you use Puma (the Rails default webserver), use Puma everywhere, even in CI/test environment. The same goes for Thin.
694+
695+
You will avoid the usual story : it works in dev but not in test environment...
696+
697+
If you want to test datatables with a lot of data you might need this kind of tricks : https://robots.thoughtbot.com/automatically-wait-for-ajax-with-capybara. (thanks CharlieIGG)
698+
685699
## ProTips™
686700

687701
### Create a master parent class (Easy)

0 commit comments

Comments
 (0)