diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-11-27 14:53:10 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-11-27 14:53:10 +0300 |
commit | 8f4b6d51f0c55fcbef8e53e2994b9f2b21069d1d (patch) | |
tree | 30d69cd1a585d8f6b7128fed76100277815a3558 /spec | |
parent | 312e3b1e16d479e1b64878cd6f8a17ff4a9fad05 (diff) | |
parent | b9df1a63550c78396d43b661bd24d2745604f6fc (diff) |
Merge branch 'jcorcuera/gitlab-ce-issue_3428'
Diffstat (limited to 'spec')
-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 |