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

strip_attribute_spec.rb « concerns « models « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 4357bc93361eadae15683a6f41a23a27cb46195b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe 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