spec the behavior of nil subjects

This commit is contained in:
http://jneen.net/ 2017-03-02 17:43:05 -08:00
parent a5c05544cf
commit f1d3a92bd6
1 changed files with 6 additions and 0 deletions

View File

@ -1,6 +1,12 @@
require 'spec_helper'
describe Ability, lib: true do
context 'using a nil subject' do
it 'is always empty' do
expect(Ability.allowed(nil, nil).to_set).to be_empty
end
end
describe '.can_edit_note?' do
let(:project) { create(:empty_project) }
let(:note) { create(:note_on_issue, project: project) }