#465: Added specs for StatisticPolicy

This commit is contained in:
Vokhmin Alexey V 2015-04-14 00:10:22 +03:00
parent 0c35d117fa
commit f2d3b3cbd4
2 changed files with 14 additions and 1 deletions

View File

@ -11,6 +11,7 @@ class StatisticsController < ApplicationController
] ]
def index def index
authorize :statistic
respond_to do |format| respond_to do |format|
format.html format.html
format.json do format.json do
@ -76,4 +77,4 @@ class StatisticsController < ApplicationController
raise ActiveRecord::RecordNotFound raise ActiveRecord::RecordNotFound
end end
end end

View File

@ -0,0 +1,12 @@
require 'spec_helper'
RSpec.describe StatisticPolicy, type: :policy do
subject { described_class }
permissions :index? do
it "grants access to user" do
expect(subject).to permit(User.new, :statistic)
end
end
end