debian-mirror-gitlab/spec/models/concerns/strip_attribute_spec.rb

22 lines
470 B
Ruby
Raw Normal View History

2019-07-07 11:18:12 +05:30
# frozen_string_literal: true
2015-12-23 02:04:40 +05:30
require 'spec_helper'
2020-07-28 23:09:34 +05:30
RSpec.describe StripAttribute do
2015-12-23 02:04:40 +05:30
let(:milestone) { create(:milestone) }
2021-10-27 15:23:28 +05:30
describe ".strip_attributes!" do
it { expect(Milestone).to respond_to(:strip_attributes!) }
2015-12-23 02:04:40 +05:30
it { expect(Milestone.strip_attrs).to include(:title) }
end
2021-10-27 15:23:28 +05:30
describe "#strip_attributes!" do
2015-12-23 02:04:40 +05:30
before do
milestone.title = ' 8.3 '
milestone.valid?
end
it { expect(milestone.title).to eq('8.3') }
end
end