Sha256: e06deb3a533e854b4f94294b1640623aefbed5660232d1b3495b52028680191e

Contents?: true

Size: 564 Bytes

Versions: 7

Compression:

Stored size: 564 Bytes

Contents

require 'spec_helper'

module FinePrint
  describe HomeController, type: :controller do
    routes { FinePrint::Engine.routes }

    before(:each) do
      setup_controller_spec
    end

    it "won't get index unless authorized" do
      get :index
      expect(response.status).to eq 403
      
      sign_in @user
      get :index
      expect(response.status).to eq 403
    end
    
    it 'must get index if authorized' do
      sign_in @user
      @user.is_admin = true
      get :index
      expect(response).to redirect_to contracts_path
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
fine_print-6.0.1 spec/controllers/home_controller_spec.rb
fine_print-6.0.0 spec/controllers/home_controller_spec.rb
fine_print-5.0.0 spec/controllers/home_controller_spec.rb
fine_print-4.0.1 spec/controllers/home_controller_spec.rb
fine_print-4.0.0 spec/controllers/home_controller_spec.rb
fine_print-3.1.0 spec/controllers/home_controller_spec.rb
fine_print-3.0.0 spec/controllers/home_controller_spec.rb