Sha256: 2a6e943188617ef30a12ce9c4c9505cb0019c1ee6cb40badbd406952c982212d

Contents?: true

Size: 746 Bytes

Versions: 5

Compression:

Stored size: 746 Bytes

Contents

require 'spec_helper'

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

  controller do
    before_filter :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

5 entries across 5 versions & 1 rubygems

Version Path
openstax_accounts-7.13.1 spec/controllers/openstax/accounts/uses_this_engine_controller_spec.rb
openstax_accounts-7.13.0 spec/controllers/openstax/accounts/uses_this_engine_controller_spec.rb
openstax_accounts-7.12.0 spec/controllers/openstax/accounts/uses_this_engine_controller_spec.rb
openstax_accounts-7.11.0 spec/controllers/openstax/accounts/uses_this_engine_controller_spec.rb
openstax_accounts-7.10.0 spec/controllers/openstax/accounts/uses_this_engine_controller_spec.rb