Adapter Tests

Learn to add the test for the adapter, make the test pass, and learn how VCR performs.

Adapter tests

The adapter tests work between the adapter and the server, using VCR as a medium:

shared:
  api_key: 123
development:
  secret_key_base: {{secret_key_base_development}}
test:
  secret_key_base: {{secret_key_base_test}}
  twitter_api_key: "{{twitter_api_key}}"
  twitter_api_secret: "{{twitter_api_secret}}"
production:
  secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
Adding "AvatarAdapter" block to avatar_adapter_spec.rb file in spec/models/ directory

This test has no dependency on the client, which is shown passing in a double rather than an actual User instance. Using a VCR cassette, we create a new adapter and assert that the adapter provides the expected URL when queried. The test also doesn’t have a particular dependency on the Twitter gem, beyond the ...