diff --git a/spec/models/abilities/common_spec.rb b/spec/models/abilities/common_spec.rb index ed12c797d..8dd9b3c9f 100644 --- a/spec/models/abilities/common_spec.rb +++ b/spec/models/abilities/common_spec.rb @@ -104,7 +104,7 @@ describe Abilities::Common do it { should be_able_to(:destroy, own_budget_investment_image) } it { should_not be_able_to(:destroy, budget_investment_image) } - it { is_expected.not_to be_able_to(:manage, ProposalDashboardAction) } + it { should_not be_able_to(:manage, ProposalDashboardAction) } describe 'flagging content' do it { should be_able_to(:flag, debate) } @@ -162,16 +162,16 @@ describe Abilities::Common do end describe 'proposals dashboard' do - it { is_expected.to be_able_to(:dashboard, own_proposal) } - it { is_expected.not_to be_able_to(:dashboard, proposal) } + it { should be_able_to(:dashboard, own_proposal) } + it { should_not be_able_to(:dashboard, proposal) } end describe 'publishing proposals' do let(:draft_own_proposal) { create(:proposal, :draft, author: user) } - it { is_expected.to be_able_to(:publish, draft_own_proposal) } - it { is_expected.not_to be_able_to(:publish, own_proposal) } - it { is_expected.not_to be_able_to(:publish, proposal) } + it { should be_able_to(:publish, draft_own_proposal) } + it { should_not be_able_to(:publish, own_proposal) } + it { should_not be_able_to(:publish, proposal) } end describe "when level 2 verified" do diff --git a/spec/models/abilities/everyone_spec.rb b/spec/models/abilities/everyone_spec.rb index 9aa8808e1..dd7c9a21c 100644 --- a/spec/models/abilities/everyone_spec.rb +++ b/spec/models/abilities/everyone_spec.rb @@ -34,5 +34,5 @@ describe Abilities::Everyone do it { should be_able_to(:read_results, finished_budget) } it { should_not be_able_to(:read_results, reviewing_ballot_budget) } - it { is_expected.not_to be_able_to(:manage, ProposalDashboardAction) } + it { should_not be_able_to(:manage, ProposalDashboardAction) } end diff --git a/spec/models/proposal_dashboard_action_spec.rb b/spec/models/proposal_dashboard_action_spec.rb index 9834ca2e1..13383cc4f 100644 --- a/spec/models/proposal_dashboard_action_spec.rb +++ b/spec/models/proposal_dashboard_action_spec.rb @@ -20,25 +20,25 @@ describe ProposalDashboardAction do let(:request_to_administrators) { true } let(:action_type) { 'resource' } - it { is_expected.to be_valid } + it { should be_valid } context 'when validating title' do context 'and title is blank' do let(:title) { nil } - it { is_expected.not_to be_valid } + it { should_not be_valid } end context 'and title is very short' do let(:title) { 'abc' } - it { is_expected.not_to be_valid } + it { should_not be_valid } end context 'and title is very long' do let(:title) { 'a' * 81 } - it { is_expected.not_to be_valid } + it { should_not be_valid } end end @@ -46,19 +46,19 @@ describe ProposalDashboardAction do context 'and description is blank' do let(:description) { nil } - it { is_expected.not_to be_valid } + it { should_not be_valid } end context 'and description is very short' do let(:description) { 'abc' } - it { is_expected.not_to be_valid } + it { should_not be_valid } end context 'and description is very long' do let(:description) { 'a' * 256 } - it { is_expected.not_to be_valid } + it { should_not be_valid } end end @@ -66,19 +66,19 @@ describe ProposalDashboardAction do context 'and day_offset is nil' do let(:day_offset) { nil } - it { is_expected.not_to be_valid } + it { should_not be_valid } end context 'and day_offset is negative' do let(:day_offset) { -1 } - it { is_expected.not_to be_valid } + it { should_not be_valid } end context 'and day_offset is not an integer' do let(:day_offset) { 1.23 } - it { is_expected.not_to be_valid } + it { should_not be_valid } end end @@ -86,19 +86,19 @@ describe ProposalDashboardAction do context 'and required_supports is nil' do let(:required_supports) { nil } - it { is_expected.not_to be_valid } + it { should_not be_valid } end context 'and required_supports is negative' do let(:required_supports) { -1 } - it { is_expected.not_to be_valid } + it { should_not be_valid } end context 'and required_supports is not an integer' do let(:required_supports) { 1.23 } - it { is_expected.not_to be_valid } + it { should_not be_valid } end end @@ -108,13 +108,13 @@ describe ProposalDashboardAction do context 'and no request_to_administrators' do let(:request_to_administrators) { false } - it { is_expected.not_to be_valid } + it { should_not be_valid } end context 'and request_to_administrators' do let(:request_to_administrators) { true } - it { is_expected.to be_valid } + it { should be_valid } end end @@ -124,14 +124,14 @@ describe ProposalDashboardAction do context 'and no request_to_administrators' do let(:request_to_administrators) { false } - it { is_expected.to be_valid } + it { should be_valid } end end context 'when action type is nil' do let(:action_type) { nil } - it { is_expected.not_to be_valid } + it { should_not be_valid } end end diff --git a/spec/models/proposal_executed_dashboard_action_spec.rb b/spec/models/proposal_executed_dashboard_action_spec.rb index 12f4ac17e..6072d4867 100644 --- a/spec/models/proposal_executed_dashboard_action_spec.rb +++ b/spec/models/proposal_executed_dashboard_action_spec.rb @@ -17,24 +17,24 @@ describe ProposalExecutedDashboardAction do let(:executed_at) { Time.current } let(:comments) { '' } - it { is_expected.to be_valid } + it { should be_valid } context 'when proposal is nil' do let(:proposal) { nil } - it { is_expected.not_to be_valid } + it { should_not be_valid } end context 'when proposal_dashboard_action is nil' do let(:proposal_dashboard_action) { nil } - it { is_expected.not_to be_valid } + it { should_not be_valid } end context 'when executed_at is nil' do let(:executed_at) { nil } - it { is_expected.not_to be_valid } + it { should_not be_valid } end context 'when the action sends a request to the administrators' do @@ -43,19 +43,19 @@ describe ProposalExecutedDashboardAction do context 'and comments are blank' do let(:comments) { '' } - it { is_expected.not_to be_valid } + it { should_not be_valid } end context 'and comments have value' do let(:comments) { Faker::Lorem.sentence } - it { is_expected.to be_valid } + it { should be_valid } end end context 'when it has been already executed' do let!(:executed) { create(:proposal_executed_dashboard_action, proposal: proposal, proposal_dashboard_action: proposal_dashboard_action) } - it { is_expected.not_to be_valid } + it { should_not be_valid } end end