diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-06-14 14:51:12 +0300 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-06-14 14:51:12 +0300 |
commit | 3ade826065f38e3734090cf34fbfc28b68ba79d0 (patch) | |
tree | 8894c90dc892086df16782f2c54ca8f6b8b4adb6 /spec/models/deployment_spec.rb | |
parent | e8f09f02bf8b0053f276a8e5ce0bdd18c621a1a3 (diff) |
Add specs for models and services
Diffstat (limited to 'spec/models/deployment_spec.rb')
-rw-r--r-- | spec/models/deployment_spec.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/models/deployment_spec.rb b/spec/models/deployment_spec.rb new file mode 100644 index 00000000000..b273018707f --- /dev/null +++ b/spec/models/deployment_spec.rb @@ -0,0 +1,17 @@ +require 'spec_helper' + +describe Deployment, models: true do + subject { build(:deployment) } + + it { is_expected.to belong_to(:project) } + it { is_expected.to belong_to(:environment) } + it { is_expected.to belong_to(:user) } + it { is_expected.to belong_to(:deployable) } + + it { is_expected.to delegate_method(:name).to(:environment).with_prefix } + it { is_expected.to delegate_method(:commit).to(:project) } + it { is_expected.to delegate_method(:commit_title).to(:commit).as(:try) } + + it { is_expected.to validate_presence_of(:ref) } + it { is_expected.to validate_presence_of(:sha) } +end |