This rule was added in rubocop-rspec 2.14.0. We were already applying it most of the time.
28 lines
897 B
Ruby
28 lines
897 B
Ruby
require "rails_helper"
|
|
|
|
describe Dashboard::ExecutedAction do
|
|
let(:proposal) { create(:proposal) }
|
|
let(:action) { create(:dashboard_action, request_to_administrators: true) }
|
|
|
|
it "is invalid when proposal is nil" do
|
|
action = build(:dashboard_executed_action, proposal: nil)
|
|
expect(action).not_to be_valid
|
|
end
|
|
|
|
it "is invalid when action is nil" do
|
|
action = build(:dashboard_executed_action, action: nil)
|
|
expect(action).not_to be_valid
|
|
end
|
|
|
|
it "is invalid when executed_at is nil" do
|
|
action = build(:dashboard_executed_action, executed_at: nil)
|
|
expect(action).not_to be_valid
|
|
end
|
|
|
|
it "when action has been already executed it is invalid" do
|
|
_executed = create(:dashboard_executed_action, proposal: proposal, action: action)
|
|
action = build(:dashboard_executed_action, proposal: proposal, action: action)
|
|
expect(action).not_to be_valid
|
|
end
|
|
end
|