Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-11-27 14:53:10 +0300
committerDouwe Maan <douwe@gitlab.com>2015-11-27 14:53:10 +0300
commit8f4b6d51f0c55fcbef8e53e2994b9f2b21069d1d (patch)
tree30d69cd1a585d8f6b7128fed76100277815a3558 /spec
parent312e3b1e16d479e1b64878cd6f8a17ff4a9fad05 (diff)
parentb9df1a63550c78396d43b661bd24d2745604f6fc (diff)
Merge branch 'jcorcuera/gitlab-ce-issue_3428'
Diffstat (limited to 'spec')
-rw-r--r--spec/models/concerns/strip_attribute_spec.rb20
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