require "paperclip/matchers"
Dir[File.dirname(__FILE__) + "/support/**/*.rb"].each {|f| require f }

RSpec.configure do |config|
  # Include paperclip shoulda matchers
  config.include Paperclip::Shoulda::Matchers

  # Better spec documentation output on chained expectations
  config.expect_with :rspec do |expectations|
    expectations.include_chain_clauses_in_custom_matcher_descriptions = true
  end

  # Use rspec mocks
  config.mock_with :rspec do |mocks|
    mocks.verify_partial_doubles = true
  end

  # Allow using focused tagging
  config.filter_run :focus
  config.run_all_when_everything_filtered = true

  # Add custom helpers for request specs
  config.include Authentication::Helpers, type: :request
  config.include JSONResponse::Helpers, type: :request

  # Add helper macros for request specs
  config.extend StatusCodes::Macros, type: :request
  config.extend Authentication::Macros, type: :request
  config.extend JSONResponse::Macros, type: :request
end
