Lynn's Dev Blog
  • About
  • Rails
  • Ruby
  • Experience
Sign in Subscribe

RSpec

A collection of 2 posts
How to use and test an AJAX request in Rails
Rails

How to use and test an AJAX request in Rails

What's AJAX? AJAX (Asynchronous Javascript and XML) is a kind of technique that can send HTTP requests and exchange data with a server by Javascript. It's an important and practical technique to enhance the user experience, especially when we want to achieve the effect that updating the partial content and
Aug 22, 2021 4 min read
RSpec - Use shared_examples to avoid duplicate test examples
Rails

RSpec - Use shared_examples to avoid duplicate test examples

It's common to see a before_action method that need executing in different controller actions. At the same time, when writing RSpec tests for these actions, it's easily to write down context blocks whose test examples are almost the same, and only a let declaration is different. The code might
Aug 1, 2021 3 min read
Page 1 of 1
Lynn's Dev Blog © 2023
Powered by Ghost