Yeah, John, as I'm using active_model_serializers <https://github.com/rails-api/active_model_serializers/tree/0-10-stable/docs> gem, it makes it possible to define caching in a serializer <https://github.com/rails-api/active_model_serializers/blob/0-10-stable/docs/general/caching.md> (model level). What I was trying to achieve is to fix failing specs that passed before adding caching in serializers.
Thank you for your response. On Wed, 24 Apr 2019 at 21:25, Jon Rowe <[email protected]> wrote: > I was unaware serialisers cached attribute at the model level, how > interesting. > > Depending on what you want to test depends on how you should deal with it, > if you don’t care about receiving fresh data either of your earlier > solutions are fine. But you should consider if you want your update to > “bust the cache” and return fresh data. > > Cheers > Jon Rowe > --------------------------- > [email protected] > jonrowe.co.uk > > On 24 April 2019 at 06:28, Surya wrote: > > Although I'm not aware of your setup nor do I know what exactly you're > trying to achieve. > > However, the failing spec does state the fact that you're not updating it > bursting your cache. What are the odds you not coming across this issue in > production? As you wouldn't have a null store in prod, and if it continues > to give you old address then I believe spec was broken for good reason. > > Sent from phone, please ignore brevity. > > -- > You received this message because you are subscribed to a topic in the > Google Groups "rspec" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/rspec/0m457NKBWFE/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > [email protected]. > To post to this group, send email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/rspec/dejalu-217-6799f603-4dc3-400f-baf2-ab4fac66a9f2%40jonrowe.co.uk > <https://groups.google.com/d/msgid/rspec/dejalu-217-6799f603-4dc3-400f-baf2-ab4fac66a9f2%40jonrowe.co.uk?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "rspec" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/rspec/CAJGQ%3DvbFQbbaT9qA2Z_ZeRjXOTDfHpuuKSw2%2B52vi89%2BEVayYQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
