aboutsummaryrefslogtreecommitdiffstats
path: root/spec/support/referential.rb
AgeCommit message (Collapse)Author
2018-03-30Fix spec/features/calendars_permissions_spec.rb to use correct Workgroup ↵Luc Donnet
Refs #6258 @1
2018-01-31Refs #5683 @2H; Fix specs and refactor action_linksZog
Note: Did not fix the missing workgroup in the calendar mailer
2018-01-03Merge branch 'master' into ↵Luc Donnet
5024-prevent-duplicate-referentials-from-being-created-during-parallel-db-transactions--rb201711271659
2017-12-15Fixes: #5281@1.2h; View specs and minor CR change from #50065281-workbench-import-structural-bug-reading-zipRobert
- CR change from #5006, severity of zip file messages :warning -> :error - View specs for showing import_messages
2017-12-13spec/support/referential: Restore old exclusions for truncationTeddy Wing
Since the tests I was trying to use `truncation` for are now skipped, remove these exceptions and revert this line back to what it was before all this mess. Refs #5024
2017-12-13referential_lock_during_creation_spec: Make truncation strategy stickTeddy Wing
The `truncation: true` strategy wasn't sticking. The config `before` block only ran once for this test file. Instead of attaching the filter to the `it` blocks, put it on the `context`. This correctly gets each test to run in a transaction. Remove the `truncation: false` filter I had added previously as this didn't do what I wanted it to: it prevented the `before` block from running instead of filtering out tests with `truncation: true`. Refs #5024
2017-12-13spec/support/referential: Eliminate data errors in truncation testsTeddy Wing
After the first `truncation: true` test ran, all tables would be cleared. This caused errors as our tests rely on a referential like this existing: Referential.create(name: 'first') It also caused problems with `LineReferential` as the `:chouette_line` factory depends on an existing `LineReferential` associated to the `first` Referential. Add the `referentials` and `line_referentials` tables to the exclusion list when truncating so these tables don't get cleared and the 'first' records persist across test runs like before. To prevent errors trying to unnecessarily switch to the 'first' referential in `truncation: true` tests, disable that functionality by adding a filter to exclude these tests from the normal transactional `before(:each)` config block. Refs #5024
2017-11-29spec/support/referential: Rename `:js` filter to `:truncation`Teddy Wing
This `before` hook allows tests to use the "truncation" database cleanup strategy. It doesn't do anything explicitly JavaScript-related. Rather, it was named JS because it was intended to be used for feature tests with JavaScript. However, now that I need to use it for a couple tests in `spec/models/referential_spec.rb`, the `:js` name doesn't make sense. Rename the filter to something that says what it does, not how it should be used. Refs #5024
2017-11-21Change the way we name classescedricnjanga
We now always use modules for namespaces => same structure for models, decorators, policies...
2017-09-27spec/support/referential.rb: Use factoriesTeddy Wing
Instead of creating the objects directly in ActiveRecord, use our existing factories for these records as suggested by Robert. Refs #3520
2017-09-25spec/support/referential.rb: Remove `output` initialisationTeddy Wing
Since the `output` attribute is now initialised automatically in the `Workbench#initialize_output` `before_validation` callback, the one I added here before I created the callback can be removed. Instead we'll rely on the callback to create a new `ReferentialSuite` for us. Refs #3520
2017-09-25Workbench: Validate presence of `output`Teddy Wing
Ensure all workbenches always have an associated `ReferentialSuite` by validating presence of the `output` attribute. In order to pass the 'should have a valid factory' test, we need to define a `ReferentialSuite` factory and set up a default association on `output` in the `Workbench` factory. We also need to add set `output` when creating a `Workbench` in `spec/support/referential.rb`, otherwise we get a validation error that breaks the tests. Clean up the formatting of that call. In order to pass a `ReferentialSuite`, I just create one above, but I'm not sure if I should be using a `find_or_create` mechanism like the other associated objects do above. Refs #3520
2017-09-12Change some specs to have all the wokbenches name to be 'Gestion de l'offre' ↵cedricnjanga
like in application controller
2017-08-17Model ApiKey add belongs_to organisationXinhui
2016-11-19Use code to define and find 'first' Organisation in specs. Refs #1782Alban Peignier
2016-10-18Relation Workbench - LineReferential & StopAreaReferentialXinhui
Refs #1784
2016-05-15Associate LineReferential to Referential. Create ReferentialLines to manage ↵Alban Peignier
lines in Referential. Refs #826
2015-12-16Add route_sections for tracesBruno Perles
2015-03-09Solving merge V2_5 pbsZakaria BOUZIANE
2015-02-20refactor rule parameter set, move to organisation's levelMarc Florisson
2015-02-13Fix spec with databasecleaner and apartmentLuc Donnet
2015-02-09Initialize first javascript rspec testsLuc Donnet
2015-02-04Try to fix travis to support apartment for specLuc Donnet
2015-01-07Fix spec and update devise usageLuc Donnet
2015-01-05Initialize rails 4 migrationLuc Donnet
2012-08-30fix referential creation in supportMarc Florisson
2012-08-30fix Referential creationMarc Florisson
2012-08-30Et avec des :: ?Alban Peignier
2012-08-30Comme quoi c'est pas la longueur qui compteAlban Peignier
2012-08-30Give a try to a nice syntax without long termsAlban Peignier
2012-08-29add subscriptionMarc Florisson
2012-06-27Use when possible a first referential created before the spec transactionAlban Peignier