diff options
author | Jose Corcuera <jzcorcuera@gmail.com> | 2015-11-26 18:16:50 +0300 |
---|---|---|
committer | Jose Corcuera <jzcorcuera@gmail.com> | 2015-11-26 18:16:50 +0300 |
commit | b9df1a63550c78396d43b661bd24d2745604f6fc (patch) | |
tree | 39fc0be59dc254abc7c4838725f6e8c650d4e6da /spec/models | |
parent | 68a4533818b96c405e657e8c1d49c72e755de8db (diff) |
Strip attributes for Milestone and Issuable. #3428
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/concerns/strip_attribute_spec.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/models/concerns/strip_attribute_spec.rb b/spec/models/concerns/strip_attribute_spec.rb new file mode 100644 index 00000000000..6445e29c3ef --- /dev/null +++ b/spec/models/concerns/strip_attribute_spec.rb @@ -0,0 +1,20 @@ +require 'spec_helper' + +describe Milestone, "StripAttribute" do + let(:milestone) { create(:milestone) } + + describe ".strip_attributes" do + it { expect(Milestone).to respond_to(:strip_attributes) } + it { expect(Milestone.strip_attrs).to include(:title) } + end + + describe "#strip_attributes" do + before do + milestone.title = ' 8.3 ' + milestone.valid? + end + + it { expect(milestone.title).to eq('8.3') } + end + +end |