Files
nairobi/spec/models/abilities/everyone_spec.rb
Juan Salvador Pérez García 28e17abe72 Syntax for specs adjusted for consistency reasons
is_expected.to has been replaced by should
is_expected.not_to has been replaced by should_not
2018-07-17 17:53:18 +02:00

39 lines
1.3 KiB
Ruby

require 'rails_helper'
require 'cancan/matchers'
describe Abilities::Everyone do
subject(:ability) { Ability.new(user) }
let(:user) { nil }
let(:debate) { create(:debate) }
let(:proposal) { create(:proposal) }
let(:reviewing_ballot_budget) { create(:budget, phase: 'reviewing_ballots') }
let(:finished_budget) { create(:budget, phase: 'finished') }
it { should be_able_to(:index, Debate) }
it { should be_able_to(:show, debate) }
it { should_not be_able_to(:edit, Debate) }
it { should_not be_able_to(:vote, Debate) }
it { should_not be_able_to(:flag, Debate) }
it { should_not be_able_to(:unflag, Debate) }
it { should be_able_to(:index, Proposal) }
it { should be_able_to(:show, proposal) }
it { should_not be_able_to(:edit, Proposal) }
it { should_not be_able_to(:vote, Proposal) }
it { should_not be_able_to(:flag, Proposal) }
it { should_not be_able_to(:unflag, Proposal) }
it { should be_able_to(:show, Comment) }
it { should be_able_to(:index, SpendingProposal) }
it { should_not be_able_to(:create, SpendingProposal) }
it { should be_able_to(:index, Budget) }
it { should be_able_to(:read_results, finished_budget) }
it { should_not be_able_to(:read_results, reviewing_ballot_budget) }
it { should_not be_able_to(:manage, ProposalDashboardAction) }
end