Sha256: 30d096b03a932abfb322a2d87f35fd934b2809eab6e650153df76ad0a1be64d7
Contents?: true
Size: 520 Bytes
Versions: 8
Compression:
Stored size: 520 Bytes
Contents
require 'spec_helper' class ApisController < ActionController::Base include Clearance::Controller before_filter :authorize respond_to :js def show render text: 'response' end end describe ApisController do before do Rails.application.routes.draw do resource :api, only: [:show] end end after do Rails.application.reload_routes! end it 'responds with HTTP status code 401 when denied' do get :show, format: :js subject.should respond_with(:unauthorized) end end
Version data entries
8 entries across 8 versions & 1 rubygems