diff options
author | Stan Hu <stanhu@gmail.com> | 2019-05-22 00:07:37 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2019-05-22 09:19:07 +0300 |
commit | 37a335e60edd4f4c8b61fd2f9ffe0f1d27e3bfb8 (patch) | |
tree | 1e1d0aad5fdfe0ba1a9cecae6c402313b7be5c54 /spec/models/deployment_spec.rb | |
parent | d707e2a49f2efe4670b5ebe62fb61554640ca7e9 (diff) |
Fix remaining failures in shoulda-matcher
Starting with Rails 5, belongs_to now adds a presence validation to the
association, and so as of shoulda-matchers 4.0.0 the belong_to matcher
follows suit and tests that this validation is there by setting the
association to nil and asserting that there are validation errors. This
exposed an error with the `validate_branches` method: we need to check
the source and target project exist.
Diffstat (limited to 'spec/models/deployment_spec.rb')
-rw-r--r-- | spec/models/deployment_spec.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/spec/models/deployment_spec.rb b/spec/models/deployment_spec.rb index f51322e1404..1dceef3fc00 100644 --- a/spec/models/deployment_spec.rb +++ b/spec/models/deployment_spec.rb @@ -5,8 +5,8 @@ require 'spec_helper' describe Deployment do subject { build(:deployment) } - it { is_expected.to belong_to(:project) } - it { is_expected.to belong_to(:environment) } + it { is_expected.to belong_to(:project).required } + it { is_expected.to belong_to(:environment).required } it { is_expected.to belong_to(:user) } it { is_expected.to belong_to(:deployable) } |