Sha256: 4b2a936d4f2c97ba2bf6bd1f2f728d33ae9b1a94d7cf75680851e124d7f66ca9

Contents?: true

Size: 737 Bytes

Versions: 1

Compression:

Stored size: 737 Bytes

Contents

require 'spec_helper'

RSpec.describe "Controllers that use this engine", type: :controller do

  controller do
    before_action :authenticate_user!
    def action_needing_authentication; end
  end

  it 'should not freak out for what rails thinks are weird formats' do
    # When accounts-rails intercepts a request to authenticate a user and that request
    # has what Rails sees as a weird format, e.g.:
    #   https://example.org/qa/271/section/4.6
    # it was freaking out.  This spec makes sure it handles that kind of request URL

    routes.draw { get "action_needing_authentication" => "anonymous#action_needing_authentication" }

    expect { get :action_needing_authentication, format: :'6' }.not_to raise_error
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
openstax_accounts-8.0.0 spec/controllers/openstax/accounts/uses_this_engine_controller_spec.rb