From 062762089b09bfc49ead95e485eb6e152dea9af2 Mon Sep 17 00:00:00 2001 From: raluka Date: Thu, 27 Aug 2015 12:36:35 +0200 Subject: [PATCH] changed wrong test for ability --- app/models/ability.rb | 4 ++-- spec/models/ability_spec.rb | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/models/ability.rb b/app/models/ability.rb index 28acd4f0..2b78cc06 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -138,7 +138,7 @@ class Ability can :manage, SponsorshipLevel, conference_id: conf_ids_for_organizer can :manage, Ticket, conference_id: conf_ids_for_organizer can :index, Comment, commentable_type: 'Event', - commentable_id: Event.where(conference_id: conf_ids_for_organizer).pluck(:id) + commentable_id: Event.where(conference_id: conf_ids_for_organizer).pluck(:id) end def signed_in_with_cfp_role(user) @@ -158,7 +158,7 @@ class Ability can :manage, Commercial, commercialable_type: 'Event', commercialable_id: Event.where(conference_id: conf_ids_for_cfp).pluck(:id) can :index, Comment, commentable_type: 'Event', - commentable_id: Event.where(conference_id: conf_ids_for_cfp).pluck(:id) + commentable_id: Event.where(conference_id: conf_ids_for_cfp).pluck(:id) end def signed_in_with_info_desk_role(user) diff --git a/spec/models/ability_spec.rb b/spec/models/ability_spec.rb index 30593a75..73812dc1 100644 --- a/spec/models/ability_spec.rb +++ b/spec/models/ability_spec.rb @@ -141,8 +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(:create, event.comment_threads.first) } it{ should be_able_to(:index, event.comment_threads.first) } + it{ should_not be_able_to(:index, other_event.comment_threads.first) } end context 'when user has the role cfp' do @@ -200,8 +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) } + it{ should_not be_able_to(:index, other_event.comment_threads.first) } end context 'when user has the role info_desk' do @@ -259,8 +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) } + it{ should_not be_able_to(:index, other_event.comment_threads.first) } end context 'when user has the role volunteers_coordinator' do @@ -318,8 +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_not be_able_to(:index, other_event.comment_threads.first) } it 'should be_able to :manage Vposition' it 'should be_able to :manage Vday' end