shared_context 'stubbed spade requests' do
  include_context 'ignore permissions'

  render_views

  before do
    stub_request(:post, "#{Settings.spade.endpoint}/track").to_return(:status => 204, :body => "", :headers => {})
  end
end

shared_context 'it creates any tracking call' do

  before do
    stub_request(:post, "#{Settings.spade.endpoint}/track").to_return(:status => 204, :body => "", :headers => {})
  end

  before(:example) do
    expect_any_instance_of(Faraday::Connection).to receive(:post).with('/track', hash_including(:data => instance_of(String))).and_return(:status => 204, :body => "", :headers => {})
  end
end