Closed
@jejacks0n

Description

I wanted to use the typical RSpec before filters, so I tagged several of my resources as:

resource_spec.rb

resource "Resource Name", api: :json do
  # specs...
end

spec_helper.rb

RSpec.configure do |config|
  config.before(:each, api: :json) do
    header 'Authorization', "Bearer [access token]"
    header 'Content-Type', 'application/json'
    header 'Accept', 'application/json'
  end
end

It fails on the header, because that's part of the DSL, and doesn't seem to be available any other way. I dug around a good bit, but there doesn't seem to be a way to specify headers/params within a before filter -- which would be nice, because I have to duplicate this at the top of all of the specs.

Thanks for a great library, it's been working really well for me and has been a pleasure to work with.