Sha256: e48534dbb7a6d3966854499c7de70c2c3d22f19552d95c8ed73c574192f00066

Contents?: true

Size: 880 Bytes

Versions: 7

Compression:

Stored size: 880 Bytes

Contents

require 'spec_helper'

describe 'routes for Clearance' do
  context 'signup disabled' do
    before(:all) do
      Clearance.configure do |config|
        config.allow_sign_up = false
      end

      Rails.application.reload_routes!
    end

    after :all do
      Clearance.configuration = Clearance::Configuration.new
      Rails.application.reload_routes!
    end

    it 'does not route sign_up' do
      expect(get: 'sign_up').not_to be_routable
    end

    it 'does not route to users#create' do
      expect(post: 'users').not_to be_routable
    end

    it 'does not route to users#new' do
      expect(get: 'users/new').not_to be_routable
    end
  end

  context 'signup enabled' do
    it 'does route sign_up' do
      expect(get: 'sign_up').to be_routable
    end

    it 'does route to users#create' do
      expect(post: 'users').to be_routable
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
clearance-1.4.3 spec/routing/clearance_routes_spec.rb
clearance-1.4.2 spec/routing/clearance_routes_spec.rb
clearance-1.4.1 spec/routing/clearance_routes_spec.rb
clearance-1.4.0 spec/routing/clearance_routes_spec.rb
clearance-1.3.0 spec/routing/clearance_routes_spec.rb
clearance-1.2.1 spec/routing/clearance_routes_spec.rb
clearance-1.2.0 spec/routing/clearance_routes_spec.rb