debian-mirror-gitlab/spec/models/concerns/strip_attribute_spec.rb
2021-10-27 15:23:28 +05:30

22 lines
470 B
Ruby

# 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