Created
July 20, 2016 20:02
-
-
Save MrCoffey/751cb4c3b987f6e17e5468d4e364d743 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module Requests | |
| module JsonHelpers | |
| def json | |
| JSON.parse(response.body) | |
| end | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'vcr' | |
| require 'support/vcr_setup.rb' | |
| require 'support/request_helpers' | |
| RSpec.configure do |config| | |
| # This allows to call `expect(json['content']).to eq(content) ` ;) | |
| config.include Requests::JsonHelpers, type: :request | |
| config.expect_with :rspec do |expectations| | |
| expectations.include_chain_clauses_in_custom_matcher_descriptions = true | |
| end | |
| # config.filter_run focus: true | |
| config.expect_with :rspec do |expectations| | |
| expectations.syntax = :expect | |
| end | |
| config.mock_with :rspec do |mocks| | |
| mocks.syntax = :expect | |
| mocks.verify_partial_doubles = true | |
| # https://www.relishapp.com/rspec/rspec-mocks/v/3-0/docs/verifying-doubles/using-an-instance-double | |
| mocks.verify_doubled_constant_names = true | |
| end | |
| config.example_status_persistence_file_path = 'tmp/rspec_examples.txt' | |
| config.order = :defined | |
| config.color = true | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'vcr' | |
| VCR.configure do |c| | |
| c.cassette_library_dir = 'spec/vcr_cassettes' | |
| c.hook_into :webmock | |
| c.configure_rspec_metadata! | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment