Commit Graph

45 Commits

Author SHA1 Message Date
Roman Greshny
4b49d1b132 fixed issue with rendering Hash which appears in rails 4.2.0.beta4 2014-11-05 16:34:08 +02:00
Steve Klabnik
c19a254154 Merge pull request #632 from gauthier-delacroix/Default_namespace_inheritance
Default namespace option
2014-09-25 19:41:33 -04:00
Andrey Chernih
90343cea4d Make sure render json: ..., each_serializer: ... is working with Enumerables
If you try to render Enumerable with custom `each_serializer` then it will render with default serializer instead:

```ruby
render json: sequel_scope, each_serializer: CustomSerializer
```

This commit fixes this behaviour. Most likely fixes https://github.com/rails-api/active_model_serializers/issues/664 as well
2014-09-25 16:59:47 +04:00
Gauthier Delacroix
adc3fc9742 Default serializer tests
Based on namespace serializer tests except namespace is set in
default_serializer_options
2014-09-03 14:58:22 +02:00
Steve Klabnik
922dd273c9 Merge pull request #620 from tristandunn/td-notifications
Avoid overwriting notifications for template assertions.
2014-08-31 20:02:08 -04:00
Tristan Dunn
610aeb2e92 Avoid overwriting notifications for template assertions. 2014-08-29 08:18:44 -05:00
Theodore Konukhov
dde1492934 tests for namespaced controlleler 2014-08-26 18:07:31 +02:00
Steve Klabnik
92f1db0137 Merge pull request #596 from bolshakov/feature/instumentation
Test::Unit assert_serializer implemented
2014-08-22 15:25:52 -04:00
Tema Bolshakov
c5d9d97f26 Assert with serializer class 2014-08-20 12:34:34 +04:00
Tema Bolshakov
865ab64025 rename spec file 2014-08-20 11:33:39 +04:00
Tema Bolshakov and Dmitry Myaskovskiy
eaedcefa4e Test::Unit assert_serializer implemented
So you can assert specific serializer to be used.
2014-08-18 18:04:51 +04:00
Vladimir Lyzo
c4e6cd48b6 Add failing test: serialize array with format_keys w/o root 2014-08-15 14:45:51 +04:00
Kyle Fritz
76c8de7b9f root key format 2014-04-14 13:45:12 -04:00
Santiago Pastorino
1ec499bd64 Use Minitest::Test instead of ActiveModel::TestCase 2014-01-09 21:52:10 -02:00
Santiago Pastorino
ed9a5288f9 Revert "Merge branch 'context'"
This reverts commit 1bd8180a94, reversing
changes made to 9bb32331f4.
2014-01-07 15:02:09 -02:00
Adrian Mugnolo and Santiago Pastorino
0d8ef2b165 Nest scope under context option 2014-01-06 15:50:30 -02:00
Santiago Pastorino
67c550f2ee Serialize embedding in root deeply nested associations
Closes #444
2014-01-02 18:34:11 -02:00
Santiago Pastorino and Adrian Mugnolo
8f03596d7b Use railtie + initialize on tests
Use Rails::Application#initialize! instead of Rails::Engine#load_generators in
integration tests.
2013-12-30 12:03:45 -02:00
Santiago Pastorino
7c68ee4b3f Remove unneeded require 2013-12-26 19:47:52 -02:00
Santiago Pastorino
f18594a980 Add missing json require 2013-12-26 17:16:48 -02:00
Todd Bealmear
6f04f86ae5 Fixed test for Rails versions prior to 4 2013-11-05 10:42:55 -08:00
Todd Bealmear
f10f72c763 Fixed Rails 4 Controller Scaffold Generator. 2013-11-04 17:31:19 -08:00
Jorge Bejar
021efae95b Change hardcoded class in favor of using provided serializer class in AR integration tests 2013-11-03 18:21:21 -02:00
Santiago Pastorino
66f9256534 Embed objects should return singular and not wrap in array
Closes #437
2013-11-01 14:22:52 -02:00
Santiago Pastorino
5598bb0f79 Make Associations in root work with ArraySerializer
Closes #414
2013-10-31 17:27:36 -02:00
Santiago Pastorino
4d4b820cbe has_one returns arrays with roots pluralized 2013-10-30 15:26:13 -02:00
Arthur Neves
860acad9af s/side_load/embed_in_root 2013-10-24 14:12:02 -04:00
Santiago Pastorino
cef6f85f44 Deprecate include in favor of side_load 2013-10-24 15:09:26 -02:00
Santiago Pastorino
48db253765 embed_in_root is now side_load 2013-10-24 14:57:41 -02:00
Santiago Pastorino
df5ef33ae6 Allow to turn off ams
Closes #378

You can define now

```
def default_serializer_options
  { serializer: false }
end
```
2013-10-23 20:34:34 -02:00
Santiago Pastorino
06e4c2c9d6 Test attributes declared as strings
Thanks @mikegee

Closes #380
2013-10-22 11:55:32 -02:00
Santiago Pastorino
73774649e3 Implement Generators 2013-10-18 17:49:21 -02:00
Santiago Pastorino
94a83c1cc0 Make relationship graph of AR integration tests bigger 2013-10-18 17:49:21 -02:00
Santiago Pastorino
23e6ed32be Add default_serializer_options test 2013-10-18 17:49:20 -02:00
Santiago Pastorino
75e9a2599d Store attributes as they are instead of converting them into Strings 2013-10-18 17:49:20 -02:00
Santiago Pastorino
aa23e811cc Use controller name as root when serializing an array and not root is defined 2013-10-18 17:49:20 -02:00
Santiago Pastorino
6f3503c965 Use serializer name as root when root not set 2013-10-18 17:49:19 -02:00
Santiago Pastorino
8462a73f3a Make render json work when not using AMS 2013-10-18 17:49:19 -02:00
Santiago Pastorino
29148cbe1c Add AC::Serialization#serialization_scope as a class level method 2013-10-18 17:49:19 -02:00
Santiago Pastorino
e6993c677b Add missing requires 2013-10-18 17:49:18 -02:00
Santiago Pastorino
fa61314d0e Add AR integration tests 2013-10-18 17:49:18 -02:00
Santiago Pastorino
4c7599cfff Use more meaningful model names for tests 2013-10-18 17:49:18 -02:00
Santiago Pastorino
0d4dfb69a9 Fix directories the project is on top level dir 2013-10-18 17:49:17 -02:00
Santiago Pastorino
a25c352525 Move models and serializers in test to fixtures.rb file 2013-10-18 17:49:17 -02:00
Santiago Pastorino
0d3b56e9cf Implement AC integration 2013-10-18 17:49:17 -02:00