created tests for user ability
This commit is contained in:
parent
eab2894fad
commit
84cd952b57
3 changed files with 13 additions and 7 deletions
|
|
@ -141,7 +141,8 @@ describe 'User' do
|
|||
it{ should_not be_able_to(:manage, other_event.difficulty_level) }
|
||||
it{ should be_able_to(:manage, event.commercials.first) }
|
||||
it{ should_not be_able_to(:manage, other_event.commercials.first) }
|
||||
it{ should be_able_to([:read, :create], event.comment_threads.first) }
|
||||
it{ should be_able_to(:create, event.comment_threads.first) }
|
||||
it{ should be_able_to(:index, event.comment_threads.first) }
|
||||
end
|
||||
|
||||
context 'when user has the role cfp' do
|
||||
|
|
@ -199,6 +200,8 @@ describe 'User' do
|
|||
it{ should_not be_able_to(:manage, other_event.difficulty_level) }
|
||||
it{ should be_able_to(:manage, event.commercials.first) }
|
||||
it{ should_not be_able_to(:manage, other_event.commercials.first) }
|
||||
it{ should be_able_to(:create, event.comment_threads.first) }
|
||||
it{ should be_able_to(:index, event.comment_threads.first) }
|
||||
end
|
||||
|
||||
context 'when user has the role info_desk' do
|
||||
|
|
@ -256,6 +259,8 @@ describe 'User' do
|
|||
it{ should_not be_able_to(:manage, other_event.difficulty_level) }
|
||||
it{ should_not be_able_to(:manage, event.commercials.first) }
|
||||
it{ should_not be_able_to(:manage, other_event.commercials.first) }
|
||||
it{ should_not be_able_to(:create, event.comment_threads.first) }
|
||||
it{ should_not be_able_to(:index, event.comment_threads.first) }
|
||||
end
|
||||
|
||||
context 'when user has the role volunteers_coordinator' do
|
||||
|
|
@ -313,6 +318,8 @@ describe 'User' do
|
|||
it{ should_not be_able_to(:manage, other_event.difficulty_level) }
|
||||
it{ should_not be_able_to(:manage, event.commercials.first) }
|
||||
it{ should_not be_able_to(:manage, other_event.commercials.first) }
|
||||
it{ should_not be_able_to(:create, event.comment_threads.first) }
|
||||
it{ should_not be_able_to(:index, event.comment_threads.first) }
|
||||
it 'should be_able to :manage Vposition'
|
||||
it 'should be_able to :manage Vday'
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue