spec the behavior of nil subjects
This commit is contained in:
parent
a5c05544cf
commit
f1d3a92bd6
1 changed files with 6 additions and 0 deletions
|
@ -1,6 +1,12 @@
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
describe Ability, lib: true do
|
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
|
describe '.can_edit_note?' do
|
||||||
let(:project) { create(:empty_project) }
|
let(:project) { create(:empty_project) }
|
||||||
let(:note) { create(:note_on_issue, project: project) }
|
let(:note) { create(:note_on_issue, project: project) }
|
||||||
|
|
Loading…
Reference in a new issue