Files
grecia/spec/models/abilities/organization_spec.rb
Bertocq 6ec6f64675 Enable RSpec/DescribeClass rubocop rspec cop & fix issues
Manually fixes all issues & "stashed" false positives at .rubocop_todo.yml

Read about the cop at http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/DescribeClass
2018-01-07 00:20:55 +01:00

25 lines
734 B
Ruby

require 'rails_helper'
require 'cancan/matchers'
describe 'Abilities::Organization' do
subject(:ability) { Ability.new(user) }
let(:user) { organization.user }
let(:organization) { create(:organization) }
let(:debate) { create(:debate) }
let(:proposal) { create(:proposal) }
it { should be_able_to(:show, user) }
it { should be_able_to(:edit, user) }
it { should be_able_to(:index, Debate) }
it { should be_able_to(:show, debate) }
it { should_not be_able_to(:vote, debate) }
it { should be_able_to(:index, Proposal) }
it { should be_able_to(:show, proposal) }
it { should_not be_able_to(:vote, Proposal) }
it { should be_able_to(:create, Comment) }
it { should_not be_able_to(:vote, Comment) }
end