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:
authorJose Corcuera <jzcorcuera@gmail.com>2015-11-26 18:16:50 +0300
committerJose Corcuera <jzcorcuera@gmail.com>2015-11-26 18:16:50 +0300
commitb9df1a63550c78396d43b661bd24d2745604f6fc (patch)
tree39fc0be59dc254abc7c4838725f6e8c650d4e6da /spec
parent68a4533818b96c405e657e8c1d49c72e755de8db (diff)
Strip attributes for Milestone and Issuable. #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